{assign var="datetime" value=$file->GetFileCreateTime()}
{assign var="namespace" value=$file->GetNamespace()}
{assign var="classes" value=$file->GetClasses()}
{assign var="uses" value=$file->GetUses()}
<?php
/**
 * Created by FFB.
 * Company: Shenzhen Zhixun Information Tec. Nanchang Com.
 * Copyright: ShenzhenZhixun
 * Email: eastbus@126.com
 * User: FFB
 * 文件不允许修改，自动生成
 */

namespace {$namespace};

{section name=index loop=$uses}
use {{$uses[index]}};
{/section}
{section name=index loop=$classes}
{assign var="className" value=$classes[index]->GetClassName()}
{assign var="tableName" value=$classes[index]->GetTable()->GetName()}
{assign var="attrs" value=$classes[index]->GetAttrs()}
{assign var="extends" value=$classes[index]->GetExtends()}
{assign var="tableNameHump" value=$classes[index]->GetTable()->GetNameForHump()}
use common\table\{{$database}}\query\{{$tableNameHump}}Query;
use common\table\{{$database}}\getter_setter\{{$tableNameHump}}Trait;

class {$className}{foreach item=e from=$extends key=i}{if $i == 0} extends {/if}{$e}{/foreach}{
    use {$tableNameHump}Trait;

    /**
     * @return {{$tableNameHump}}Query|object|\yii\db\ActiveQuery
     */
    public static function find()
    {
        return Yii::createObject({{$tableNameHump}}Query::class, [get_called_class()]);
    }
    public static function tableName()
    {
        return '{literal}{{{/literal}{{$tableName}}{literal}}}{/literal}';
    }
}
{/section}
