/**
  * @param ModelInterface $article
  * @param array $post
  * @param Form $form
  * @return int
  */
 public function edit(ModelInterface $article, array $post, Form $form = null)
 {
     $article->setDateModified();
     $result = parent::edit($article, $post);
     // find page first, if exists delete it before updating.
     if (!$result instanceof Form) {
         $pageResult = $this->updateMenuItem($this->getById($article->getArticleId()), $post);
     }
     return $result;
 }
Exemple #2
0
 /**
  * @param int $id
  * @param null $col
  * @return array|mixed|\UthandoCommon\Model\ModelInterface
  */
 public function getById($id, $col = null)
 {
     $article = parent::getById($id, $col);
     $this->populate($article, true);
     return $article;
 }
 /**
  * @param $id
  * @param null $cols
  * @return \UthandoNewsletter\Model\Message
  */
 public function getById($id, $cols = null)
 {
     $model = parent::getById($id, $cols);
     $this->populate($model, true);
     return $model;
 }
 /**
  * @param $id
  * @return SubscriberModel
  */
 public function getSubscriberWithSubscriptions($id)
 {
     $model = parent::getById($id);
     $this->populate($model, true);
     return $model;
 }