In EE 3.0, if you used something like this:
$result = ee('Model')->get('ModelName')->fields('myColumn')->all();You would get all results with just the myColumn field set.
In ee 3.1 if you use ->fields() on a model it will only return one result no matter what limit you set or how else you retrieve the data.
Removing ->fields() and leaving every other filter or limit directive on a model gets the desired results.
We are using them with multiple addons, multiple devs and multiple EE 3.1 installs.
It is our models, but we are using the model interface laid out in the docs and it worked in EE 3.0:
class Group extends Model
{
protected static $_primary_key = 'tag_group_id';
protected static $_table_name = 'tag_groups';
protected $tag_group_id;
protected $tag_group_name;
protected $tag_group_short_name;
}
//END GroupI did it using the member model (since it extends Model and ChannelEntry does not) and the bug persists. It’s only when its not the primary key in the ->fields()
This produces 1 result:
ee('Model')->get('Member')->fields('screen_name')->all()->getDictionary('screen_name', 'screen_name');This produces many:
ee('Model')->get('Member')->all()->getDictionary('screen_name', 'screen_name');Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.