本文整理汇总了PHP中app\models\BaseModel::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseModel::initialize方法的具体用法?PHP BaseModel::initialize怎么用?PHP BaseModel::initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\BaseModel
的用法示例。
在下文中一共展示了BaseModel::initialize方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
public function initialize()
{
parent::initialize();
$this->setSource($this->className());
$this->hasManyToMany('id', 'App\\Models\\Relationships\\EventHasPack', 'pack_id', 'event_id', 'App\\Models\\Event', 'id', ['alias' => 'Events']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\PackHasProduct', 'pack_id', 'product_id', 'App\\Models\\Product', 'id', ['alias' => 'Products']);
}
示例2: initialize
public function initialize()
{
parent::initialize();
$this->setSource($this->className());
$this->belongsTo('period_id', 'App\\Models\\Period', 'id', ['alias' => 'Period', 'foreignKey' => ['message' => 'The period_id does not exist on the Period model']]);
$this->hasOne('id', 'App\\Models\\Event', 'scheduling_id', ['alias' => 'Event']);
}
示例3: initialize
public function initialize()
{
parent::initialize();
$this->setSource($this->className());
$this->hasOne('id', 'App\\Models\\Event', 'guestList_id', ['alias' => 'Event']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Belong', 'guestList_id', 'user_id', 'App\\Models\\User', 'id', ['alias' => 'Users']);
}
示例4: initialize
public function initialize()
{
parent::initialize();
$this->setSource($this->className());
$this->hasOne('id', 'App\\Models\\User', 'rrpp_id', ['alias' => 'User']);
$this->hasMany('id', 'App\\Models\\Local', 'owner_id', ['alias' => 'Locals']);
}
示例5: initialize
public function initialize()
{
parent::initialize();
$this->setSource($this->className());
$this->belongsTo('user_id', 'App\\Models\\User', 'id', ['alias' => 'User', 'foreignKey' => ['message' => 'The user_id does not exist on the User model']]);
$this->belongsTo('provider_id', 'App\\Models\\Provider', 'id', ['alias' => 'Provider', 'foreignKey' => ['message' => 'The provider_id does not exist on the Provider model']]);
}
示例6: initialize
public function initialize()
{
parent::initialize();
$this->setSource($this->className());
$this->belongsTo('event_id', 'App\\Models\\Event', 'id', ['alias' => 'Event', 'foreignKey' => ['message' => 'The event_id does not exist on the Event model']]);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Appear', 'photo_id', 'user_id', 'App\\Models\\User', 'id', ['alias' => 'UsersAppearing']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\PhotoHasHashTag', 'photo_id', 'hashTag_id', 'App\\Models\\HashTag', 'id', ['alias' => 'HashTags']);
}
示例7: initialize
public function initialize()
{
parent::initialize();
$this->setSource($this->className());
$this->belongsTo('owner_id', 'App\\Models\\RRPP', 'id', ['alias' => 'Owner', 'foreignKey' => ['message' => 'The owner_id does not exist on the RRPP model']]);
$this->hasMany('id', 'App\\Models\\Event', 'local_id', ['alias' => 'Events']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Follow', 'local_id', 'user_id', 'App\\Models\\User', 'id', ['alias' => 'Followers']);
}
示例8: initialize
public function initialize()
{
parent::initialize();
$this->setSource($this->className());
$this->belongsTo('local_id', 'App\\Models\\Local', 'id', ['alias' => 'Local', 'foreignKey' => ['message' => 'The local_id does not exist on the Local model']]);
$this->belongsTo('guestList_id', 'App\\Models\\GuestList', 'id', ['alias' => 'GuestList', 'foreignKey' => ['allowNulls' => true, 'message' => 'The guestList_id does not exist on the GuestList model']]);
$this->belongsTo('scheduling_id', 'App\\Models\\Scheduling', 'id', ['alias' => 'Scheduling', 'foreignKey' => ['allowNulls' => true, 'message' => 'The scheduling_id does not exist on the Scheduling model']]);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Attend', 'event_id', 'user_id', 'App\\Models\\User', 'id', ['alias' => 'Users']);
$this->hasMany('id', 'App\\Models\\Photo', 'event_id', ['alias' => 'Photos']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\EventHasHashTag', 'event_id', 'hashTag_id', 'App\\Models\\HashTag', 'id', ['alias' => 'HashTags']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\EventHasMusicTag', 'event_id', 'musicTag_id', 'App\\Models\\MusicTag', 'id', ['alias' => 'MusicTags']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\EventHasPack', 'event_id', 'pack_id', 'App\\Models\\Pack', 'id', ['alias' => 'Packs']);
}
示例9: initialize
public function initialize()
{
parent::initialize();
/**
* Table name.
*/
$this->setSource($this->className());
/**
* Relationships.
*/
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Follower', 'user_id', 'follower_id', 'App\\Models\\User', 'id', ['alias' => 'Followers']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Follower', 'follower_id', 'user_id', 'App\\Models\\User', 'id', ['alias' => 'Following']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Appear', 'user_id', 'photo_id', 'App\\Models\\Photo', 'id', ['alias' => 'Photos']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Follow', 'user_id', 'local_id', 'App\\Models\\Local', 'id', ['alias' => 'LocalsFollowed']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Attend', 'user_id', 'event_id', 'App\\Models\\Event', 'id', ['alias' => 'Events']);
$this->hasManyToMany('id', 'App\\Models\\Relationships\\Belong', 'user_id', 'guestList_id', 'App\\Models\\GuestList', 'id', ['alias' => 'GuestLists']);
$this->belongsTo('rrpp_id', 'App\\Models\\RRPP', 'id', ['alias' => 'RRPPprofile', 'foreignKey' => ['allowNulls' => true, 'message' => 'The rrpp_id does not exist on the RRPP model']]);
$this->hasMany('id', 'App\\Models\\Profile', 'user_id', ['alias' => 'Profiles']);
}
示例10: initialize
public function initialize()
{
parent::initialize();
$this->setSource($this->className());
$this->hasMany('id', 'App\\Models\\Profile', 'provider_id', ['alias' => 'Profiles']);
}
示例11: initialize
public function initialize()
{
parent::initialize();
$this->setSource('users');
$this->hasMany('id', "App\\Models\\BookInstance", 'user_id', ["alias" => "bookInstances"]);
}