本文整理汇总了PHP中Relationship::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Relationship::__construct方法的具体用法?PHP Relationship::__construct怎么用?PHP Relationship::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Relationship
的用法示例。
在下文中一共展示了Relationship::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: RelationshipHandler
function RelationshipHandler($db, $base_module = "")
{
$this->db = $db;
$this->base_module = $base_module;
parent::__construct();
//end function RelationshipHandler
}
示例2: __construct
/**
* Constructor function
*
* @param string|int $field
* @param array|string $info
* @param ModelConfig $config
*/
public function __construct($field, $info, $config)
{
parent::__construct($field, $info, $config);
$relationship = $config->model->{$field}();
$otherModel = $relationship->model;
$this->table = $otherModel->table();
$this->column = $otherModel::$key;
$this->foreignKey = $relationship->foreign;
}
示例3: __construct
/**
* Constructor function
*
* @param string|int $field
* @param array|string $info
* @param ModelConfig $config
*/
public function __construct($field, $info, $config)
{
parent::__construct($field, $info, $config);
//set up the model depending on what's passed in
$model = is_a($config, 'Admin\\Libraries\\ModelConfig') ? $config->model : $config;
$relationship = $model->{$field}();
$otherModel = $relationship->model;
$this->table = $otherModel->table();
$this->column = $otherModel::$key;
$this->foreignKey = $relationship->foreign;
}
示例4: __construct
public function __construct(Entity $fkEntity, $fkColumnName, Entity $otherEntity, Entity $ownerEntity)
{
parent::__construct($fkEntity, array($fkColumnName => $otherEntity), $ownerEntity);
}
示例5: __construct
public function __construct(Entity $fkEntity, array $fkColumnNameToEntityMap)
{
parent::__construct($fkEntity, $fkColumnNameToEntityMap, NULL);
}