private static function update(Article $model) { $db = Database::getInstance('app'); $query = "UPDATE articles SET title= :title, introNewsData= :introNewsData, newsData= :newsData, picture= :picture, thumbnail= :thumbnail, createdAt= :createdAt, category_id= :category_id, isPosted= :isPosted WHERE id = :id"; $result = $db->prepare($query); $result->execute([':id' => $model->getId(), ':title' => $model->getTitle(), ':introNewsData' => $model->getIntroNewsData(), ':newsData' => $model->getNewsData(), ':picture' => $model->getPicture(), ':thumbnail' => $model->getThumbnail(), ':createdAt' => $model->getCreatedAt(), ':category_id' => $model->getCategory_id(), ':isPosted' => $model->getIsPosted()]); }
private static function update(Article $model) { $db = Database::getInstance('app'); $query = "UPDATE articles SET title= :title, content= :content, post_date= :post_date, articleImage= :articleImage, titleBG= :titleBG, contentBG= :contentBG WHERE id = :id"; $result = $db->prepare($query); $result->execute([':id' => $model->getId(), ':title' => $model->getTitle(), ':content' => $model->getContent(), ':post_date' => $model->getPost_date(), ':articleImage' => $model->getArticleImage(), ':titleBG' => $model->getTitleBG(), ':contentBG' => $model->getContentBG()]); }
/** * Exclude object from result * * @param ChildArticle $article Object to remove from the list of results * * @return $this|ChildArticleQuery The current query, for fluid interface */ public function prune($article = null) { if ($article) { $this->addUsingAlias(ArticleTableMap::COL_ID, $article->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a ChildArticle object. * * @param ChildArticle $v * @return $this|\Models\Comment The current object (for fluent API support) * @throws PropelException */ public function setArticle(ChildArticle $v = null) { if ($v === null) { $this->setIdArticle(NULL); } else { $this->setIdArticle($v->getId()); } $this->aArticle = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildArticle object, it will not be re-added. if ($v !== null) { $v->addComment($this); } return $this; }
/** * Filter the query by a related \Models\Article object * * @param \Models\Article|ObjectCollection $article The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildCommentQuery The current query, for fluid interface */ public function filterByArticle($article, $comparison = null) { if ($article instanceof \Models\Article) { return $this->addUsingAlias(CommentTableMap::COL_ID_ARTICLE, $article->getId(), $comparison); } elseif ($article instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(CommentTableMap::COL_ID_ARTICLE, $article->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByArticle() only accepts arguments of type \\Models\\Article or Collection'); } }