I’m working on a site that has been running on ExpressionEngine since ExpressionEngine 1 (though it’s been upgraded from 2 to 3 and on to 5 over the years). I was looking at the SQL database recently and noticed that new channel data fields are now creating their own tables (starting with exp_channel_data_field_104). Is that normal behaviour or should I be concerned that this is a sign that things could start to go a bit wrong with my ExpressionEngine install and its database?
Anyway, I appreciate any insights or advice anyone has to offer—I’m definitely far from knowledgeable about SQL. Thank you!
yes, but now have an api, for example im write an Plugin (pi.pljuign_name.php) and have this function
public function getCanal(){
$this->channel_id = (ee()->TMPL->fetch_param('channel_id'))?ee()->TMPL->fetch_param('channel_id'):0;
$entradas=array();
$entries = ee('Model')->get('ChannelEntry')
->filter('author_id', ee()->session->userdata('member_id'))
->filter('channel_id',$this->channel_id ) // or whatever you want/need to filter on
->order('title', 'ASC');
foreach($entries->all() as $ent){
$entradas[]=array(
"chan_title"=>$ent->title,
"chan_url_title"=>$ent->url_title,
"chan_entry_id"=>$ent->entry_id,
);
}
return ee()->TMPL->parse_variables(ee()->TMPL->tagdata, $entradas);
}
and you can get Custom Fields by Field ID like
$ent->field_id_1//or the id of your Custom Field
or
$field = ee('Model')->get('ChannelField')
->filter('field_name', $ci) // or whatever you want/need to filter on
->first();
$fieldid="field_id_".$field->field_id;
$ent->{$fieldid}
> is a sign that things could start to go a bit wrong with my ExpressionEngine install
Not necessarily. All new fields are created with the new schema, EE’s models know how to handle that. As long as any add-on that is modifying entry data uses the models instead of querying exp_channel_data directly, then it will continue to work just fine.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.