phalcon模型字段别名映射

2,800次阅读

共计 251 个字符,预计需要花费 1 分钟才能阅读完成。

<?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'
        );
    }

}

正文完
 
Blood.Cold
版权声明:本站原创文章,由 Blood.Cold 2019-06-04发表,共计251字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。