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


PHP ArticleModel::load方法代碼示例

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


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

示例1: SaveArticleAction

 public function SaveArticleAction()
 {
     $request = Project::getRequest();
     $id = (int) $request->id;
     $article_model = new ArticleModel();
     $article_page_model = new ArticlePageModel();
     $article_model->load($id);
     $article_model->user_id = Project::getUser()->getDbUser()->id;
     $article_model->articles_tree_id = $request->article_cat;
     $article_model->title = $request->article_title;
     $article_model->allowcomments = (bool) $request->allow_comment;
     $article_model->rate_status = (bool) $request->allow_rate;
     $article_model->creation_date = date("Y-m-d H:i:s");
     $id = $article_model->save();
     for ($i = 0; $i < count($request->title_page); $i++) {
         $article_page_model = new ArticlePageModel();
         $article_page_model->load($request->id_page[$i]);
         $article_page_model->article_id = $id;
         $article_page_model->title = $request->title_page[$i];
         $article_page_model->p_text = $request->content_page[$i];
         $article_page_model->save();
     }
     $data = array();
     $this->_makeArticleList($data);
     $this->_view->AjaxArticleList($data);
     $this->_view->ajax();
 }
開發者ID:amanai,項目名稱:next24,代碼行數:27,代碼來源:AdminArticleController.php

示例2: SubjectVoteAction

 public function SubjectVoteAction()
 {
     $request = Project::getRequest();
     $articleId = (int) $request->getKeyByNumber(0);
     $userId = Project::getUser()->getDbUser()->id;
     $article_model = new ArticleModel();
     $article_model->load($articleId);
     $subject_vote_model = new SubjectVoteModel();
     if (count($subject_vote_model->loadUserId($userId)) <= 0 && $article_model->rate_status == ARTICLE_COMPETITION_STATUS::IN_RATE && $userId > 0 && $userId != $article_model->user_id) {
         $subject_vote_model->clear();
         $subject_vote_model->user_id = $userId;
         $article_model->votes++;
         $subject_vote_model->save();
         $article_model->save();
     }
     Project::getResponse()->redirect($request->createUrl('Article', 'CompetitionCatalog'));
 }
開發者ID:amanai,項目名稱:next24,代碼行數:17,代碼來源:ArticleController.php

示例3: createFromData

 public static function createFromData($pdo, $data)
 {
     $obj = new ArticleModel($pdo);
     $obj->load($data);
     return $obj;
 }
開發者ID:TiberiuGal,項目名稱:sgc,代碼行數:6,代碼來源:ArticleModel.php


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