Is there a good way to specify column aliases when performing find () operations on a model?
$this->User->find('first', array( 'fields' => array( 'CONCAT(firstname, ' ', surname) AS fullname', 'email', 'tel' ) );
At the moment, if I do it like this, it returns data as follows:
Array ( [0] => Array ( [fullname] => John Smith ) [User] => Array ( [email] => jsmith@example.com [tel] => 0123456789 ) )
Is there a way to return column aliases to it, such as regular columns?
Array ( [User] => Array ( [fullname] => John Smith [email] => jsmith@example.com [tel] => 0123456789 ) )
source share