/** * Create a new belongs to relationship instance. * * @param \Analogue\ORM\System\Mapper $mapper * @param Mappable $parent * @param string $foreignKey * @param string $otherKey * @param string $relation */ public function __construct(Mapper $mapper, Mappable $parent, $foreignKey, $otherKey, $relation) { $this->otherKey = $otherKey; $this->relation = $relation; $this->foreignKey = $foreignKey; parent::__construct($mapper, $parent); }
/** * Create a new has many relationship instance. * * @param Mapper $mapper * @param Mappable $parent * @param string $table * @param string $foreignKey * @param string $otherKey * @param string $relationName */ public function __construct(Mapper $mapper, $parent, $table, $foreignKey, $otherKey, $relationName = null) { $this->table = $table; $this->otherKey = $otherKey; $this->foreignKey = $foreignKey; $this->relationName = $relationName; parent::__construct($mapper, $parent); }
/** * Create a new has many relationship instance. * * @param \Analogue\ORM\System\Query $query * @param Mappable $parent * @param string $firstKey * @param string $secondKey * @return void */ public function __construct(Mapper $mapper, $farParent, $parentMap, $firstKey, $secondKey) { $this->firstKey = $firstKey; $this->secondKey = $secondKey; $this->farParent = $farParent; $this->farParentMap = $this->relatedMapper->getManager()->mapper($farParent)->getEntityMap(); $parentInstance = $this->relatedMapper->getManager()->mapper($parentMap->getClass())->newInstance(); parent::__construct($mapper, $parentInstance); }
/** * Create a new has many relationship instance. * * @param \Analogue\ORM\System\Query $query * @param Mappable $parent * @param string $foreignKey * @param string $localKey * @return void */ public function __construct(Mapper $mapper, $parentEntity, $foreignKey, $localKey) { $this->localKey = $localKey; $this->foreignKey = $foreignKey; parent::__construct($mapper, $parentEntity); }