/** * BelongsTo constructor. * @param \Notadd\Foundation\Database\Eloquent\Builder $query * @param \Notadd\Foundation\Database\Eloquent\Model $parent * @param string $foreignKey * @param string $otherKey * @param string $relation */ public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $relation) { $this->otherKey = $otherKey; $this->relation = $relation; $this->foreignKey = $foreignKey; parent::__construct($query, $parent); }
/** * BelongsToMany constructor. * @param \Notadd\Foundation\Database\Eloquent\Builder $query * @param \Notadd\Foundation\Database\Eloquent\Model $parent * @param string $table * @param string $foreignKey * @param string $otherKey * @param string null $relationName */ public function __construct(Builder $query, Model $parent, $table, $foreignKey, $otherKey, $relationName = null) { $this->table = $table; $this->otherKey = $otherKey; $this->foreignKey = $foreignKey; $this->relationName = $relationName; parent::__construct($query, $parent); }
/** * HasManyThrough constructor. * @param \Notadd\Foundation\Database\Eloquent\Builder $query * @param \Notadd\Foundation\Database\Eloquent\Model $farParent * @param \Notadd\Foundation\Database\Eloquent\Model $parent * @param string $firstKey * @param string $secondKey * @param string $localKey */ public function __construct(Builder $query, Model $farParent, Model $parent, $firstKey, $secondKey, $localKey) { $this->localKey = $localKey; $this->firstKey = $firstKey; $this->secondKey = $secondKey; $this->farParent = $farParent; parent::__construct($query, $parent); }
/** * HasOneOrMany constructor. * @param \Notadd\Foundation\Database\Eloquent\Builder $query * @param \Notadd\Foundation\Database\Eloquent\Model $parent * @param string $foreignKey * @param string $localKey */ public function __construct(Builder $query, Model $parent, $foreignKey, $localKey) { $this->localKey = $localKey; $this->foreignKey = $foreignKey; parent::__construct($query, $parent); }