/** * @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)); }
/** * @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; }