Example #1
0
 /**
  *
  * @return boolean
  */
 public function process()
 {
     $this->form->submit($this->request);
     if ($this->form->isValid()) {
         $entityModel = $this->form->getData();
         $file = $entityModel->getFile();
         $fileName = $this->getName() . '.' . $file->getClientOriginalExtension();
         $file->move($this->uploadPath, $fileName);
         $this->entity->setFile($fileName);
         $this->em->persist($this->entity);
         $this->em->flush();
         return true;
     }
     return false;
 }
Example #2
0
 /**
  * @return boolean
  */
 public function process()
 {
     $this->form->submit($this->request);
     if ($this->form->isValid()) {
         $entityModel = $this->form->getData();
         $this->entity->setContent($this->sanitizer->doClean($entityModel->getContent()));
         $this->entity->setUserName($this->sanitizer->doClean($entityModel->getUserName()));
         $this->entity->setUserEmail($this->sanitizer->doClean($entityModel->getUserEmail()));
         $this->entity->setUserWeb($this->sanitizer->doClean($entityModel->getUserWeb()));
         $this->em->persist($this->entity);
         $this->em->flush();
         return true;
     }
     return false;
 }