예제 #1
0
파일: core.php 프로젝트: brzhezinskiy/api
 /**
  * удаляет пользователя по id.
  */
 public function deleteUser($id)
 {
     $sql = new RequestBuilder($this->dbInctance);
     $sql->delete()->from('^table', array('^table' => $this->dbStruct['table']))->where('^id = :val', array('^id' => $this->dbStruct['id'], ':val' => $id));
     if (!$sql->query()->rowCount()) {
         throw new Exception("[" . __CLASS__ . "] Не удалось удалить запись! Возможно, она уже удалена.");
     }
     return new DeleteUser(array('result' => true));
 }