How to select dummy column

Tell me how to select this scenario (eq: using model::find())

SELECT *, 0 as status FROM Mymodel

where 'status' is not Mymodel member (column).

thx.



1.6k

You can do that with PHQL:

$phql = "SELECT m.*, 0 as status FROM Mymodel AS m";
$rows = $manager->executeQuery($phql);
foreach ($rows as $row) {
    echo $row->someField . "\n";
    echo $row->status . "\n";  //0
}