本文整理匯總了PHP中X2Model::relations方法的典型用法代碼示例。如果您正苦於以下問題:PHP X2Model::relations方法的具體用法?PHP X2Model::relations怎麽用?PHP X2Model::relations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類X2Model
的用法示例。
在下文中一共展示了X2Model::relations方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: relations
public function relations()
{
return array_merge(parent::relations(), array('list' => array(self::BELONGS_TO, 'X2List', array('listId' => 'nameId')), 'attachments' => array(self::HAS_MANY, 'CampaignAttachment', 'campaign')));
}
示例2: relations
/**
* @return array relational rules.
*/
public function relations()
{
return array_merge(parent::relations(), array('workflow' => array(self::BELONGS_TO, 'Workflow', 'workflowId'), 'workflowStage' => array(self::BELONGS_TO, 'WorkflowStage', 'stageNumber'), 'actionMetaData' => array(self::HAS_ONE, 'ActionMetaData', 'actionId'), 'actionText' => array(self::HAS_ONE, 'ActionText', 'actionId')));
}
示例3: relations
/**
* @return array relational rules.
*/
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array_merge(parent::relations(), array('products' => array(self::HAS_MANY, 'QuoteProduct', 'quoteId', 'order' => 'lineNumber ASC'), 'contact' => array(self::BELONGS_TO, 'Contacts', array('associatedContacts' => 'nameId'))));
}
示例4: relations
/**
* @return array relational rules.
*/
public function relations()
{
return array_merge(parent::relations(), array('order' => array(self::HAS_MANY, 'QuoteProduct', 'productId')));
}
示例5: relations
/**
* @return array relational rules.
*/
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array_merge(parent::relations(), array());
}