function RelationshipHandler($db, $base_module = "") { $this->db = $db; $this->base_module = $base_module; parent::__construct(); //end function RelationshipHandler }
/** * 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; }
/** * 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; }
public function __construct(Entity $fkEntity, $fkColumnName, Entity $otherEntity, Entity $ownerEntity) { parent::__construct($fkEntity, array($fkColumnName => $otherEntity), $ownerEntity); }
public function __construct(Entity $fkEntity, array $fkColumnNameToEntityMap) { parent::__construct($fkEntity, $fkColumnNameToEntityMap, NULL); }