Table Of Contents

骑驴找蚂蚁

全干工程师

phalcon模型字段别名映射

<?php

class Robots extends \Phalcon\Mvc\Model
{
    public $code;
    public $theYear;
    public $theName;
    public $theType;

    public function columnMap()
    {
        //Keys为表里面的真实字段名称
        //value为程序里面的名称
        return array(
            'id' => 'code',
            'the_name' => 'theName',
            'the_type' => 'theType',
            'the_year' => 'theYear'
        );
    }

}

留言