当前位置: 首页>>代码示例>>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;未经允许,请勿转载。