Illuminate\Database\Eloquent\Relations\BelongsTo::__construct PHP Метод

__construct() публичный Метод

Create a new belongs to relationship instance.
public __construct ( Builder $query, Model $parent, string $foreignKey, string $otherKey, string $relation ) : void
$query Illuminate\Database\Eloquent\Builder
$parent Illuminate\Database\Eloquent\Model
$foreignKey string
$otherKey string
$relation string
Результат void
    public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $relation)
    {
        $this->otherKey = $otherKey;
        $this->relation = $relation;
        $this->foreignKey = $foreignKey;
        parent::__construct($query, $parent);
    }

Usage Example

Пример #1
3
 public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $relationName)
 {
     $this->relationName = $relationName;
     parent::__construct($query, $parent, $foreignKey, $otherKey, $relationName);
 }
All Usage Examples Of Illuminate\Database\Eloquent\Relations\BelongsTo::__construct