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


PHP Model::newQueryWithoutScopes方法代碼示例

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


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

示例1: where

 /**
  * Add a basic where clause to the query.
  *
  * @param  string  $column
  * @param  string  $operator
  * @param  mixed   $value
  * @param  string  $boolean
  * @return $this
  */
 public function where($column, $operator = null, $value = null, $boolean = 'and')
 {
     if ($column instanceof Closure) {
         $query = $this->model->newQueryWithoutScopes();
         call_user_func($column, $query);
         $this->query->addNestedWhereQuery($query->getQuery(), $boolean);
     } else {
         call_user_func_array(array($this->query, 'where'), func_get_args());
     }
     return $this;
 }
開發者ID:visualturk,項目名稱:framework,代碼行數:20,代碼來源:Builder.php

示例2: wrap

 /**
  * Wrap the given value with the parent query's grammar.
  *
  * @param  string  $value
  * @return string
  */
 public function wrap($value)
 {
     return $this->parent->newQueryWithoutScopes()->getQuery()->getGrammar()->wrap($value);
 }
開發者ID:ProgrammingPeter,項目名稱:nba-schedule-api,代碼行數:10,代碼來源:Relation.php

示例3: newQuery

 /**
  * Get new query.
  *
  * @return \Illuminate\Database\Eloquent\Builder
  */
 public function newQuery()
 {
     return $this->model->newQueryWithoutScopes();
 }
開發者ID:guratr,項目名稱:cruddy,代碼行數:9,代碼來源:BaseRepository.php

示例4: getScopeConstraints

 /**
  * Get an array of the constraints applied by the scope.
  *
  * @param  \Illuminate\Database\Eloquent\Model $model
  * @return array
  */
 protected function getScopeConstraints(Model $model)
 {
     $builder = $model->newQueryWithoutScopes();
     $this->apply($builder, $model);
     return (array) $builder->getQuery()->wheres;
 }
開發者ID:k1ng440,項目名稱:laravel-global-scope,代碼行數:12,代碼來源:GlobalScope.php

示例5: getQueryForModelRestoration

 /**
  * Get the query for restoration.
  *
  * @param  \Illuminate\Database\Eloquent\Model  $model
  * @return \Illuminate\Database\Eloquent\Builder
  */
 protected function getQueryForModelRestoration($model)
 {
     return $model->newQueryWithoutScopes();
 }
開發者ID:bryanashley,項目名稱:framework,代碼行數:10,代碼來源:SerializesAndRestoresModelIdentifiers.php

示例6: assertModelTrashed

 /**
  * Assert that a model was soft deleted.
  *
  * @param Model $model
  * @return $this
  */
 protected function assertModelTrashed(Model $model)
 {
     /** Cannot use `fresh()` because it is different between 5.2 and 5.3. */
     $fresh = $model->newQueryWithoutScopes()->where($model->getKeyName(), $model->getKey())->first();
     PHPUnit::assertNotNull($fresh, 'Model has been removed from the database.');
     PHPUnit::assertTrue($fresh->trashed(), 'Model is not trashed.');
     return $this->seeModelInDatabase($model, [$model->getKeyName() => $model->getKey()]);
 }
開發者ID:cloudcreativity,項目名稱:laravel-json-api,代碼行數:14,代碼來源:InteractsWithModels.php


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