Пример #1
0
 /**
  * Supprime un pays en base de données depuis son code, alpha2 ou alpha3
  * 
  * @param type $code
  */
 public function deleteCountry($code)
 {
     $delete = new \Zend\Db\Sql\Delete();
     $where = $this->constructWhereFromCode($code);
     $delete->from('pays')->where($where);
     $this->tableGateway->deleteWith($delete);
 }
Пример #2
0
 /**
  * delete object to database
  * @param key
  * @return int, affected row count
  */
 protected function deleteObject($key)
 {
     $delete = new Zend\Db\Sql\Delete($this->tableName);
     $delete->where(array($this->pk => $key));
     $result = $this->execute($delete);
     if (!$result) {
         return false;
     }
     return $result->count();
 }