Example #1
0
 public function saveWithParams(Template $template = null, User $user, array $data)
 {
     if (!$template) {
         $template = new Template();
         $template->setUser($user);
     }
     if (isset($data['code'])) {
         $template->setCode($data['code']);
     }
     if (isset($data['name'])) {
         $template->setName($data['name']);
     }
     if (isset($data['titleEt'])) {
         $template->setTitleEt($data['titleEt']);
     }
     if (isset($data['titleEn'])) {
         $template->setTitleEn($data['titleEn']);
     }
     if (isset($data['contentEt'])) {
         $template->setContentEt($data['contentEt']);
     }
     if (isset($data['contentEn'])) {
         $template->setContentEn($data['contentEn']);
     }
     return $this->saveTemplate($template);
 }
Example #2
0
 public function setFormValues(Template $template = null)
 {
     if ($template) {
         $this->get('code')->setValue($template->getCode());
         $this->get('name')->setValue($template->getName());
         $this->get('titleEt')->setValue($template->getTitleEt());
         $this->get('titleEn')->setValue($template->getTitleEn());
         $this->get('contentEt')->setValue($template->getContentEt());
         $this->get('contentEn')->setValue($template->getContentEn());
     }
     return $this;
 }