/** * Return an object property * * @param string $strKey The property name * * @return mixed|null The property value or null */ public function __get($strKey) { switch ($strKey) { case 'query': return $this->strQuery; break; case 'error': $info = $this->statement->errorInfo(); return 'SQLSTATE ' . $info[0] . ': error ' . $info[1] . ': ' . $info[2]; break; case 'affectedRows': return $this->statement->rowCount(); break; case 'insertId': return $this->resConnection->lastInsertId(); break; } return null; }
public function errorInfo() { return $this->stmt->errorInfo(); }
public function errorInfo() { return $this->wrapped->errorInfo(); }
/** * @brief Writes debug output including additional SQL error info to the ownCloud log. * * @param string $output The string appended to ownCloud log. * @param \Doctrine\DBAL\Driver\Statement $query The query whose information * will be added to the debug output. * @param int $level Log level of debug output. Default is \OCP\Util::ERROR. */ public static function writeLogDbError($output, $query, $level = \OCP\Util::ERROR) { $output = $output . " SQLSTATE: " . $query->errorCode() . ". Error info: " . var_export($query->errorInfo(), true); self::writeLog($output, $level); }