public function create($data) { $form = $this->getBiboBlogForm(); $blog = new BiBoBlog(); $form->setInputFilter($blog->getInputFilter()); $form->setData($data); $user = new \stdClass(); $user->username = '******'; $user->password = '******'; $id = 1; if ($form->isValid()) { $id = $this->getBiboBlogService()->addBiBoBlog($form->getData(), $user, $form->getHydrator()); ////service call // $this->update($id, $form->getData()) ; } return $this->get($id); }
public function addAction() { $container = new Container('user_login'); if (isset($container->user) && !is_null($container->user)) { $form = $this->getBiBoBlogForm(); $request = $this->getRequest(); $container = new Container('user_login'); if ($request->isPost()) { $blog = new BiBoBlog(); $form->setInputFilter($blog->getInputFilter()); $form->setData($request->getPost()); if ($form->isValid()) { $this->getBiBoBlogService()->addBiBoBlog($form->getData(), $container->user, $form->getHydrator()); return $this->redirect()->toRoute('bi-bo-blog'); } } return array('form' => $form); } else { return $this->redirect()->toRoute('bi-bo-user'); } }
/** * {@inheritDoc} */ public function getArrayValue() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getArrayValue', array()); return parent::getArrayValue(); }