Exemplo n.º 1
0
 private function createArticle($model)
 {
     $model = Article::create($model);
     return $model;
 }
Exemplo n.º 2
0
 protected function loadNext($currentPost)
 {
     $parts = explode(' ', $this->property('sortOrder'));
     list($sortField, $sortDirection) = $parts;
     $comparator = $sortDirection == 'asc' ? '<' : '>';
     $post = ArticleModel::isPublished()->where($sortField, $comparator, $currentPost->{$sortField})->orderBy($sortField, $sortDirection == 'asc' ? 'desc' : 'asc')->first();
     if (!is_null($post)) {
         $post->setUrl($this->postPage, $this->controller);
     }
     // CW::info($post);
     return $post;
 }