コード例 #1
0
 private function createArticle($model)
 {
     $model = Article::create($model);
     return $model;
 }
コード例 #2
0
ファイル: Articles.php プロジェクト: abnmt/oc-test-plugin
 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;
 }