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

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

python - Pygame screen.blit not working -

c# - Web API response xml language -