當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Builder::whereDoesntHave方法代碼示例

本文整理匯總了PHP中Illuminate\Database\Eloquent\Builder::whereDoesntHave方法的典型用法代碼示例。如果您正苦於以下問題:PHP Builder::whereDoesntHave方法的具體用法?PHP Builder::whereDoesntHave怎麽用?PHP Builder::whereDoesntHave使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Database\Eloquent\Builder的用法示例。


在下文中一共展示了Builder::whereDoesntHave方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: whereDoesntHave

 /**
  * Add a relationship count condition to the query with where clauses.
  *
  * @param string $relation
  * @param \Closure|null $callback
  * @return \Illuminate\Database\Eloquent\Builder|static 
  * @static 
  */
 public static function whereDoesntHave($relation, $callback = null)
 {
     return \Illuminate\Database\Eloquent\Builder::whereDoesntHave($relation, $callback);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:12,代碼來源:_ide_helper.php

示例2: scopeNotTranslatedIn

 /**
  * @param \Illuminate\Database\Eloquent\Builder $query
  * @param string                                $locale
  *
  * @return \Illuminate\Database\Eloquent\Builder|static
  */
 public function scopeNotTranslatedIn(Builder $query, $locale = null)
 {
     $locale = $locale ?: $this->locale();
     return $query->whereDoesntHave('translations', function (Builder $q) use($locale) {
         $q->where($this->getLocaleKey(), '=', $locale);
     });
 }
開發者ID:dimsav,項目名稱:laravel-translatable,代碼行數:13,代碼來源:Translatable.php

示例3: scopeWithoutTag

 /**
  * {@inheritdoc}
  */
 public static function scopeWithoutTag(Builder $query, $tags, $type = 'slug')
 {
     $tags = (new static())->prepareTags($tags);
     return $query->whereDoesntHave('tags', function ($query) use($type, $tags) {
         $query->whereIn($type, $tags);
     });
 }
開發者ID:cartalyst,項目名稱:tags,代碼行數:10,代碼來源:TaggableTrait.php

示例4: scopeDoesntHaveActiveDiary

 /**
  * アクティブな日誌がないか
  * @param Builder $query
  * @return Builder|static
  */
 public function scopeDoesntHaveActiveDiary(Builder $query)
 {
     return $query->whereDoesntHave('workDiaries', function ($query) {
         $query->where('archive', false);
     });
 }
開發者ID:nana4rider,項目名稱:mdiary,代碼行數:11,代碼來源:WorkField.php

示例5: scopeWithoutActivePlayers

 /**
  * Groups with no players for a given season.
  */
 public function scopeWithoutActivePlayers(Builder $query, Season $season)
 {
     return $query->whereDoesntHave('players', function (Builder $q) use($season) {
         $q->active($season);
     });
 }
開發者ID:BibleBowl,項目名稱:account,代碼行數:9,代碼來源:Group.php

示例6: scopeWithoutAttach

 /**
  * {@inheritdoc}
  */
 public static function scopeWithoutAttach(Builder $query, $attaches, $type = 'filename')
 {
     $attaches = (new static())->prepareAttaches($attaches);
     return $query->whereDoesntHave('attaches', function ($query) use($type, $attaches) {
         $query->whereIn($type, $attaches);
     });
 }
開發者ID:AngryDeer,項目名稱:Attachfiles,代碼行數:10,代碼來源:AttachableTrait.php

示例7: scopeActive

 /**
  * @param Builder $query
  *
  * @return Builder
  */
 public function scopeActive(Builder $query)
 {
     return $query->whereDoesntHave('order');
 }
開發者ID:hughgrigg,項目名稱:ching-shop,代碼行數:9,代碼來源:Basket.php

示例8: scopeNotOnTeamSet

 public function scopeNotOnTeamSet(Builder $query, TeamSet $teamSet)
 {
     return $query->whereDoesntHave('teams', function (Builder $query) use($teamSet) {
         $query->where('teams.team_set_id', $teamSet->id);
     });
 }
開發者ID:BibleBowl,項目名稱:account,代碼行數:6,代碼來源:Player.php


注:本文中的Illuminate\Database\Eloquent\Builder::whereDoesntHave方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。