示例#1
0
 /**
  * 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  $relation
  * @return void
  */
 public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $relation)
 {
     $this->otherKey = $otherKey;
     $this->relation = $relation;
     $this->foreignKey = $foreignKey;
     parent::__construct($query, $parent);
 }
示例#2
0
 /**
  * DescendantsRelation constructor.
  *
  * @param QueryBuilder $builder
  * @param Model $model
  */
 public function __construct(QueryBuilder $builder, Model $model)
 {
     if (!NestedSet::isNode($model)) {
         throw new InvalidArgumentException('Model must be node.');
     }
     parent::__construct($builder, $model);
 }
示例#3
0
 /**
  * Create a new has many relationship instance.
  *
  * @param  \Illuminate\Database\Eloquent\Builder  $query
  * @param  \Illuminate\Database\Eloquent\Model  $parent
  * @param  string  $firstKey
  * @param  string  $secondKey
  * @return void
  */
 public function __construct(Builder $query, Model $farParent, Model $parent, $firstKey, $secondKey)
 {
     $this->firstKey = $firstKey;
     $this->secondKey = $secondKey;
     $this->farParent = $farParent;
     parent::__construct($query, $parent);
 }
 /**
  * Create a new has many relationship instance.
  *
  * @param  Illuminate\Database\Eloquent\Builder  $query
  * @param  Illuminate\Database\Eloquent\Model  $parent
  * @param  string  $table
  * @param  string  $foreignKey
  * @param  string  $otherKey
  * @return void
  */
 public function __construct(Builder $query, Model $parent, $table, $foreignKey, $otherKey)
 {
     $this->table = $table;
     $this->otherKey = $otherKey;
     $this->foreignKey = $foreignKey;
     parent::__construct($query, $parent);
 }
 /**
  * Create a new relation instance.
  *
  * @param \Illuminate\Database\Eloquent\Builder $query
  * @param \Illuminate\Database\Eloquent\Model   $farChild
  * @param \Illuminate\Database\Eloquent\Model   $parent
  * @param string                                $firstKey
  * @param string                                $localKey
  */
 function __construct(Builder $query, Model $farChild, Model $parent, $firstKey, $localKey)
 {
     $this->farChild = $farChild;
     $this->firstKey = $firstKey;
     $this->localKey = $localKey;
     parent::__construct($query, $parent);
 }
 /**
  * Create a new instance of relation.
  *
  * @param \Illuminate\Database\Eloquent\Builder $query
  * @param \Illuminate\Database\Eloquent\Model   $parent
  * @param array                                 $models
  * @param string|null                           $localKey
  * @param string                                $prefix
  * @param array                                 $foreignKeyLookup
  */
 public function __construct(Builder $query, Model $parent, array $models, $localKey = null, $prefix = '', $foreignKeyLookup = [])
 {
     $this->models = $models;
     $this->localKey = $localKey ?: $parent->getKeyName();
     $this->prefix = $prefix;
     $this->foreignKeyLookup = $foreignKeyLookup;
     parent::__construct($query, $parent);
 }
示例#7
0
文件: MorphToAny.php 项目: znck/plug
 public function __construct(Builder $query, Model $parent, string $relation, string $table)
 {
     parent::__construct($query, $parent);
     $this->table = $table;
     $this->relation = $relation;
     $this->relationClass = $relation . '_type';
     $this->relationKey = $relation . '_id';
 }
示例#8
0
 public function __construct(Builder $builder, DatabaseNode $parent, Repository $repo)
 {
     parent::__construct($builder, $parent);
     $this->repository = $repo;
     $this->localKey = $parent->getIdName();
     $this->foreignKey = $parent->getParentIdName();
     $this->rootKey = $parent->getRootIdName();
 }
 /**
  * Create a new has one or many relationship instance.
  *
  * @param  \Illuminate\Database\Eloquent\Builder  $query
  * @param  \Illuminate\Database\Eloquent\Model  $parent
  * @param  string  $foreignKey
  * @param  string  $localKey
  * @return void
  */
 public function __construct(Builder $query, Model $parent, $foreignKey, $localKey)
 {
     $this->localKey = $localKey;
     $this->foreignKey = $foreignKey;
     parent::__construct($query, $parent);
 }
 /**
  * Create a new instance of relation.
  *
  * @param \Illuminate\Database\Eloquent\Builder $query
  * @param \Illuminate\Database\Eloquent\Model   $parent
  * @param array                                 $models
  * @param string|null                           $localKey
  */
 public function __construct(Builder $query, Model $parent, array $models, $localKey = null)
 {
     $this->models = $models;
     $this->localKey = $localKey ?: $parent->getKeyName();
     parent::__construct($query, $parent);
 }
示例#11
0
 public function __construct(Builder $builder, DatabaseSortable $parent, Repository $repo)
 {
     parent::__construct($builder, $parent, $repo);
 }
 /**
  * Create a new has many relationship instance.
  *
  * @param  \Illuminate\Database\Eloquent\Builder  $query
  * @param  \Illuminate\Database\Eloquent\Model  $parent
  * @return void
  */
 public function __construct(Builder $query, Model $parent, $finder = 'get')
 {
     $this->finder = $finder;
     parent::__construct($query, $parent);
 }
示例#13
0
 public function __construct(Builder $query, Model $parent, Closure $matchSQL, Closure $matchPHP)
 {
     $this->matchSQL = $matchSQL;
     $this->matchPHP = $matchPHP;
     parent::__construct($query, $parent);
 }
示例#14
0
 public function __construct(Builder $query, Model $parent, Closure $baseConstraints = null, Closure $eagerConstraints = null)
 {
     $this->baseConstraints($baseConstraints);
     $this->eagerConstraints($eagerConstraints);
     parent::__construct($query, $parent);
 }
 public function __construct(Model $parent)
 {
     parent::__construct($parent->newQuery(), $parent);
 }