Open biakaveron opened 14 years ago
I am still seeing this issue in the latest master checkout. Any chance this will be fixed?
It works in 'unstable' branch
I tried switching to the unstable branch and I still can't seem to get this to work. This is what I do:
$meta->fields(array( 'id' => new Jelly_..., 'first_name' => new Jelly_Field_String, 'last_name' => new Jelly_Field_String, 'name' => new Jelly_Field_Expression(array( 'column' => DB::expr("CONCAT(`first_name`, ' ', `last_name`)") )) ));
This is pretty much the example code. This is where it breaks:
Jelly::query('contributor') ->select_colum(array('name')) ->select();
When running the code I get the following error message:
Database_Exception [ 1054 ]: Unknown column 'name' in 'field list' [ SELECT `name` FROM `contributors` AS `contributors` ]
Apparently expression fields are not properly aliased into a "expression AS name" statement? Or is there anything I am doing wrong?
When I trying to access $model->test, I get an ErrorException "array_key_exists(): The first argument should be either a string or an integer", line#166 in Jelly_Meta_Core class. Manual datatype casting should helps.