public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $relationName) { $this->relationName = $relationName; parent::__construct($query, $parent, $foreignKey, $otherKey, $relationName); }
/** * BelongToLang constructor. * * @param Builder $query * @param Eloquent $parent * @param string $foreignKey * @param string $otherKey * @param string $langKey * @param string $relation * @param null $lang * @param null $fallback */ public function __construct(Builder $query, Eloquent $parent, $foreignKey, $otherKey, $langKey, $relation, $lang = null, $fallback = null) { $this->lang = $lang ?: Lang::getLocale(); $this->fallback = $fallback ?: Lang::getFallback(); $this->langKey = $langKey ?: 'lang'; $this->fallbackQuery = clone $query; parent::__construct($query, $parent, $foreignKey, $otherKey, $relation); }
/** * Create a new belongs to relationship instance. * * @param \Illuminate\Database\Eloquent\Builder $query * @param \Illuminate\Database\Eloquent\Model $parent * @param string $foreignKey * @param string $otherKey * @param string $type * @param string $relation * @return void */ public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $type, $relation) { $this->morphType = $type; parent::__construct($query, $parent, $foreignKey, $otherKey, $relation); }