/** * @param $id */ public function handleActive($id) { $this->article = $this->articlesRepository->get($id); $this->article->active(!$this->article->active()); $this->articlesRepository->save($this->article); if (!$this->isAjax()) { $this->redirect('default'); } $this->redrawControl(); }
/** * @param $form */ public function formSubmitted(Form $form) { $values = $form->getValues(); if ($values->theme > '') { $values->idTheme = $this->articlesRepository->newTheme($values->theme); } $this->article = $this->articlesRepository->get($values->id); $this->article->name($values->name); $this->article->text($values->text); $this->article->pictureName($values->pictureName); $this->article->pictureDescription($values->pictureDescription); $this->article->active($values->active); $this->article->title($values->title); $this->article->description($values->description); $this->article->keywords($values->keywords); $this->article->galleryIds(json_encode($values->galleryIds)); $this->article->idTheme($values->idTheme); $this->getUrl($values); }