public __construct ( |
||
$query | ||
$parent | ||
리턴 | void |
public function __construct(Builder $query, Model $parent)
{
$this->query = $query;
$this->parent = $parent;
$this->related = $query->getModel();
$this->addConstraints();
}
/** * Create a new has many relationship instance. * * @param \LMongo\Eloquent\Builder $query * @param \LMongo\Eloquent\Model $parent * @param string $foreignKey * @param string $relation * @return void */ public function __construct(Builder $query, Model $parent, $foreignKey, $relation) { $this->relation = $relation; $this->foreignKey = $foreignKey; parent::__construct($query, $parent); }