当前位置: 首页>>代码示例>>PHP>>正文


PHP Relation::__construct方法代码示例

本文整理汇总了PHP中Illuminate\Database\Eloquent\Relations\Relation::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Relation::__construct方法的具体用法?PHP Relation::__construct怎么用?PHP Relation::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Database\Eloquent\Relations\Relation的用法示例。


在下文中一共展示了Relation::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * 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);
 }
开发者ID:flelievre,项目名称:EasyVisit,代码行数:17,代码来源:BelongsTo.php

示例2: __construct

 /**
  * 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);
 }
开发者ID:nutsdo,项目名称:nong-store,代码行数:13,代码来源:DescendantsRelation.php

示例3: __construct

 /**
  * 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);
 }
开发者ID:mawaha,项目名称:tracker,代码行数:16,代码来源:HasManyThrough.php

示例4: __construct

 /**
  * 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);
 }
开发者ID:hochanh,项目名称:Bootsoft-Bowling,代码行数:17,代码来源:BelongsToMany.php

示例5:

 /**
  * 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);
 }
开发者ID:rohitkdn,项目名称:belongs-to-through,代码行数:16,代码来源:BelongsToThrough.php

示例6: __construct

 /**
  * 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);
 }
开发者ID:dannyweeks,项目名称:belongs-to-through,代码行数:18,代码来源:BelongsToThrough.php

示例7: __construct

 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';
 }
开发者ID:znck,项目名称:plug,代码行数:8,代码来源:MorphToAny.php

示例8: __construct

 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();
 }
开发者ID:realholgi,项目名称:beetree,代码行数:8,代码来源:HasChildren.php

示例9: __construct

 /**
  * 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);
 }
开发者ID:nsoimaru,项目名称:Laravel51-starter,代码行数:15,代码来源:HasOneOrMany.php

示例10: __construct

 /**
  * 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);
 }
开发者ID:blomqvist,项目名称:belongs-to-through,代码行数:14,代码来源:BelongsToThrough.php

示例11: __construct

 public function __construct(Builder $builder, DatabaseSortable $parent, Repository $repo)
 {
     parent::__construct($builder, $parent, $repo);
 }
开发者ID:realholgi,项目名称:beetree,代码行数:4,代码来源:HasSortableChildren.php

示例12: __construct

 /**
  * 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);
 }
开发者ID:rtconner,项目名称:laravel-plusplus,代码行数:12,代码来源:CustomRelation.php

示例13: __construct

 public function __construct(Builder $query, Model $parent, Closure $matchSQL, Closure $matchPHP)
 {
     $this->matchSQL = $matchSQL;
     $this->matchPHP = $matchPHP;
     parent::__construct($query, $parent);
 }
开发者ID:jhaut,项目名称:eloquent-enhanced,代码行数:6,代码来源:RelatedTo.php

示例14: __construct

 public function __construct(Builder $query, Model $parent, Closure $baseConstraints = null, Closure $eagerConstraints = null)
 {
     $this->baseConstraints($baseConstraints);
     $this->eagerConstraints($eagerConstraints);
     parent::__construct($query, $parent);
 }
开发者ID:gez-studio,项目名称:gez-mall,代码行数:6,代码来源:NewRelation.php

示例15: __construct

 public function __construct(Model $parent)
 {
     parent::__construct($parent->newQuery(), $parent);
 }
开发者ID:danhunsaker,项目名称:eloquent-meta-relate,代码行数:4,代码来源:MetaRelation.php


注:本文中的Illuminate\Database\Eloquent\Relations\Relation::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。