public function addAction() { $form = new Form_Iadmin_MessagesAdd(); if ($this->_request->isPost()) { if ($form->isValid($this->_request->getPost())) { $hp = new HelpMessages(); $resource_id = $this->_em->find('Resources', $form->page_name->getValue()); $hp->setResource($resource_id); $hp->setDescription($form->description->getValue()); $hp->setStatus($form->status->getValue()); $this->_em->persist($hp); $this->_em->flush(); } } $this->_redirect("/iadmin/manage-help-messages"); }
public function addAction() { $form = new Form_Iadmin_MessagesAdd(); if ($this->_request->isPost()) { if ($form->isValid($this->_request->getPost())) { $hp = new HelpMessages(); $resource_id = $this->_em->find('Resources', $form->page_name->getValue()); $hp->setResource($resource_id); $hp->setDescription($form->description->getValue()); $hp->setStatus($form->status->getValue()); $created_by = $this->_em->find('Users', $this->_user_id); $hp->setCreatedBy($created_by); $hp->setCreatedDate(App_Tools_Time::now()); $hp->setModifiedBy($created_by); $hp->setModifiedDate(App_Tools_Time::now()); $this->_em->persist($hp); $this->_em->flush(); } } $this->_redirect("/iadmin/manage-help-messages"); }