i’ve a question about atk4 MVCgrid, my db table doesn’t have a field called “id” my primary key is id_material, i don’t be able to change idfield, my SQL contain a file id that doesnt’ exist so it fail.
How i can change default id primary key field (id) with my real primary key?
My simple code:
class Model_Material extends Model_Table
{
public $entity_code='material';
public $table_alias='p';
function defineFields(){
parent::defineFields();
$this->addField('id_material');
$this->addField('material');
}
}
Thank’s
All you need to do is to create an alias:
You would have more difficulties with foreign keys. You might want to keep watch on 4.2 release, which will have more flexibility.