예제 #1
0
 /**
  * @param string $sequenceName (optional) The sequence name of the inserted identifier.
  * @return int|null The last inserted identifier, or null on error
  */
 public function execute($sequenceName = null)
 {
     $sql = $this->toSQL();
     $affected = $this->inner->Cn->exec($sql);
     if ($affected === false) {
         if ($this->inner->PDOErrorsToQIErrors) {
             throw QIError::fromPDO($this->inner->Cn, $sql);
         }
         return null;
     }
     return intval($this->inner->Cn->lastInsertId($sequenceName));
 }
예제 #2
0
 /**
  * @return int The number of affected rows
  */
 public function execute()
 {
     $sql = $this->toSQL();
     $affected = $this->inner->Cn->exec($sql);
     if ($affected === false) {
         if ($this->inner->PDOErrorsToQIErrors) {
             throw QIError::fromPDO($this->inner->Cn, $sql);
         }
         return null;
     }
     return $affected;
 }