Beispiel #1
0
 /**
  * method permettant de customiser les methods increment et decrement
  *
  * @param string $column
  * @param int $step
  * @param string $sign
  *
  * @return DatabaseErrorHandler
  */
 private function incrementAction($column, $step = 1, $sign = '')
 {
     $sql = 'update `' . $this->tableName . '` set `' . $column . '` = `' . $column . '` ' . $sign . ' ' . $step;
     if (!is_null($this->where)) {
         $sql .= ' ' . $this->where;
         $this->where = null;
     }
     $stmt = $this->connection->prepare($sql);
     $this->bind($stmt, $this->whereDataBind);
     $stmt->execute();
     static::$errorInfo = $stmt->errorInfo();
     return $this->getResponseOfQuery((int) $stmt->rowCount());
 }
Beispiel #2
0
 /**
  * Execute Les request de type delete insert update
  *
  * @param $sqlstatement
  * @param array $bind
  * @return mixed
  */
 private static function executePrepareQuery($sqlstatement, array $bind = [])
 {
     $pdostatement = static::$db->prepare($sqlstatement);
     static::bind($pdostatement, $bind);
     $pdostatement->execute();
     static::$errorInfo = $pdostatement->errorInfo();
     $r = $pdostatement->rowCount();
     $pdostatement->closeCursor();
     return $r;
 }