sql - Give an alias to field name on ::find('all') -


i have field on database called name when retrieve called label.

in raw sql can this:

  select name label ... 

theres "quick way" on find without need deal entity, virtual fields etc...

i did using virtual properties on entity:

protected $_virtual = ['label'];  protected function _getlabel() {     return $this->_properties['name']; } 

a potential gotcha be... i'm using _serialize return result , not working because have expose virtual properties using $_virtual.


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -