updateOne() public method

Update item
public updateOne ( mixed $primary, array $data ) : integer
$primary mixed
$data array
return integer
Example #1
0
 /**
  * updateOne
  *
  * @param array $data
  * @return integer
  */
 public function updateOne($id, $data)
 {
     $id = (int) $id[0];
     \Application\MusicianType\Table::getInstance()->updateTypes($data['types'], $id);
     if (Session::get('image') != '') {
         $data['image'] = Session::get('image');
     }
     $result = parent::updateOne($id, $data);
     return $result;
 }
Example #2
0
 /**
  * @param mixed $primary
  * @param array $data
  * @return int
  * @throws Exception
  * @throws \Bluz\Application\Exception\NotFoundException
  */
 public function updateOne($primary, $data)
 {
     try {
         Db::handler()->beginTransaction();
         $this->saveAdditionData($data);
         $response = parent::updateOne($primary, $data);
         //Db::delete('wertwert')->where(['ee' => 3333])->execute();
         Db::handler()->commit();
         return $response;
     } catch (\PDOException $e) {
         Db::handler()->rollBack();
         throw $e;
     }
 }