Hi,
I had a little problem trying to use a for loop with a model with columnMap set and I really don't know if my solution is the best way to deal with this situation.
I have a table containing the users from my system, but i don't actually need all the columns to do this task. So I defined the following column Map:
public function columnMap(){
return array (
'id' => 'id',
'cell_phone' => 'cell_phone',
'verified' => 'verified'
);
}
When I try to get some elements using the find method and iterate I receive an error message saying 'The column 'name' doesn't make part of the column map'.
To fix this error, I was forced to specify the columns in the find method as bellow:
$this->users = Users::find(array(
'conditions' => $this->config->project->sendCondition,
'columns' => 'id, cell_phone, verified',
'limit' => 100
));
Is this the expected behavior ?
I am not saying this is a bug, but is strange.
Thank you.