상속: extends Illuminate\Database\Eloquent\Builder
예제 #1
0
파일: Post.php 프로젝트: Geekathon/corcel
 /**
  * Overriding newQuery() to the custom PostBuilder with some interesting methods
  *
  * @param bool $excludeDeleted
  * @return Corcel\PostBuilder
  */
 public function newQuery($excludeDeleted = true)
 {
     $builder = new PostBuilder($this->newBaseQueryBuilder());
     $builder->setModel($this)->with($this->with);
     $builder->orderBy('post_date', 'desc');
     if (isset($this->postType) and $this->postType) {
         $builder->type($this->postType);
     }
     if ($excludeDeleted and $this->softDelete) {
         $builder->whereNull($this->getQualifiedDeletedAtColumn());
     }
     return $builder;
 }
예제 #2
0
파일: Post.php 프로젝트: jgrossi/corcel
 /**
  * Overriding newQuery() to the custom PostBuilder with some interesting methods.
  *
  * @param bool $excludeDeleted
  *
  * @return Corcel\PostBuilder
  */
 public function newQuery($excludeDeleted = true)
 {
     $builder = new PostBuilder($this->newBaseQueryBuilder());
     $builder->setModel($this)->with($this->with);
     // disabled the default orderBy because else Post::all()->orderBy(..)
     // is not working properly anymore.
     // $builder->orderBy('post_date', 'desc');
     if (isset($this->postType) and $this->postType) {
         $builder->type($this->postType);
     }
     if ($excludeDeleted and $this->softDelete) {
         $builder->whereNull($this->getQualifiedDeletedAtColumn());
     }
     return $builder;
 }