public function editAction()
 {
     $id = (int) $this->params()->fromRoute('id', 0);
     if (!$id) {
         return $this->redirect()->toRoute('subscriber', array('action' => 'add'));
     }
     // Get the Album with the specified id.  An exception is thrown
     // if it cannot be found, in which case go to the index page.
     try {
         $subscriber = $this->getSubscriberTable()->getSubscriber($id);
     } catch (\Exception $ex) {
         return $this->redirect()->toRoute('subscriber', array('action' => 'index'));
     }
     $form = new SubscriberForm();
     $form->bind($subscriber);
     $form->get('submit')->setAttribute('value', 'Edit');
     $request = $this->getRequest();
     if ($request->isPost()) {
         $form->setInputFilter($subscriber->getInputFilter());
         $form->setData($request->getPost());
         if ($form->isValid()) {
             $this->getSubscriberTable()->saveSubscriber($subscriber);
             // Redirect to list of subscriber
             return $this->redirect()->toRoute('subscriber');
         }
     }
     return array('id' => $id, 'form' => $form);
 }
 public function update($id, $data)
 {
     $data['id'] = $id;
     $subscriber = $this->getSubscriberTable()->getSubscriber($id);
     $form = new SubscriberForm();
     $form->bind($subscriber);
     $form->setInputFilter($subscriber->getInputFilter());
     $form->setData($data);
     if ($form->isValid()) {
         $id = $this->getSubscriberTable()->saveSubscriber($form->getData());
     }
     return $this->get($id);
 }