當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。