示例#1
0
 /**
  *
  * @param unknown $id        	
  * @return boolean|unknown
  */
 public function find($id)
 {
     $id = (int) $id;
     $rowset = $this->_table->tableGateway->select(array('id' => $id));
     try {
         if ($rowset) {
             $row = $rowset->current();
         } else {
             $row = false;
         }
     } catch (\Exception $e) {
         return \Model\Custom\Error::trigger($e, $params);
     }
     return $row;
 }
示例#2
0
 /**
  * delete by id of the table or array condition
  *
  * @param int/array $id        	
  */
 public function delete($id)
 {
     try {
         if (is_array($id)) {
             $effectedRows = $this->tableGateway->delete($id);
         } else {
             $effectedRows = $this->tableGateway->delete(array('id' => (int) $id));
         }
     } catch (\Exception $e) {
         return \Model\Custom\Error::trigger($e, $params);
     }
     return $effectedRows;
 }