首页 > 解决方案 > PHP Propel 委托行为

问题描述

我已经实现了这样的行为

<table name="user" idMethod="native" phpName="User">
    <column name="id" phpName="Id" type="INTEGER" size="12" primaryKey="true" autoIncrement="true" required="true"/>
    <behavior name="delegate">
        <parameter name="to" value="user_profile" />
    </behavior>
    <vendor type="mysql">
        <parameter name="Engine" value="InnoDB"/>
    </vendor>
</table>
<table name="user_profile" idMethod="native" phpName="UserProfile">
    <column name="avatar" phpName="Avatar" type="VARCHAR" size="255"/>
    <column name="birthday" phpName="Birthday" type="DATE" required="true" defaultValue="0000-00-00"/>
    <vendor type="mysql">
        <parameter name="Engine" value="InnoDB"/>
    </vendor>
</table>

在迁移和构建模型命令之后,我仍然无法获得 ActiveRecord 方法,我错过了一步吗?

标签: phpmysqlinnodbpropel2

解决方案


推荐阅读