Esempio n. 1
0
 /**
  * 
  * @param Base_Form_Abstract $form
  * @param type $id
  * @throws Logic_Ws_Exception
  */
 public function updateIP(Base_Form_Abstract $form, $id)
 {
     $values = $form->getValues();
     $clients = $values['clients'];
     unset($values['clients']);
     $clientIpModel = new WsClientHasWsSaveip();
     try {
         $oldRow = $this->findOne($id);
         $oldRow->setFromArray($values);
         $oldRow->save();
         $clientIpModel->deleteClients($id);
         foreach ($clients as $val) {
             $clientIpModel->insertClientIP(array('ws_client_id' => $val, 'ws_saveip_id' => $id));
         }
     } catch (Exception $e) {
         throw new Logic_Ws_Exception($e->getMessage());
     }
 }