public function add($dataPost) { $entry = new EntryEntity(); $form = $this->getEntryForm(); $form->setData($dataPost); if ($form->isValid()) { $entry->exchangeArray($form->getData()); $this->getEntryTable()->add($entry); return true; } return false; }
public function add(Entry $entry) { $data = array('name' => $entry->getName(), 'email' => $entry->getEmail(), 'website' => $entry->getWebsite(), 'message' => $entry->getMessage()); $this->insert($data); }