本文整理汇总了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();
}
示例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'));
}
示例3: createFromData
public static function createFromData($pdo, $data)
{
$obj = new ArticleModel($pdo);
$obj->load($data);
return $obj;
}