* @since 4.5.0
*/
public static function insertid($table=null) {
- return(\OC_DB::insertid($table));
+ return \OC::$server->getDatabaseConnection()->lastInsertId($table);
}
/**
* @since 4.5.0
*/
public static function beginTransaction() {
- \OC_DB::beginTransaction();
+ \OC::$server->getDatabaseConnection()->beginTransaction();
}
/**
* @since 4.5.0
*/
public static function commit() {
- \OC_DB::commit();
+ \OC::$server->getDatabaseConnection()->commit();
}
/**
* @since 8.0.0
*/
public static function rollback() {
- \OC_DB::rollback();
+ \OC::$server->getDatabaseConnection()->rollback();
}
/**
* @since 4.5.0
*/
public static function isError($result) {
- return(\OC_DB::isError($result));
+ // Doctrine returns false on error (and throws an exception)
+ return $result === false;
}
/**
* @since 6.0.0
*/
public static function getErrorMessage() {
- return(\OC_DB::getErrorMessage());
+ return \OC::$server->getDatabaseConnection()->getError();
}
}
* @since 5.0.0
*/
public static function tmpFile( $postfix='' ) {
- return(\OC_Helper::tmpFile( $postfix ));
+ return \OC::$server->getTempManager()->getTemporaryFile($postfix);
}
/**
* @since 5.0.0
*/
public static function tmpFolder() {
- return(\OC_Helper::tmpFolder());
+ return \OC::$server->getTempManager()->getTemporaryFolder();
}
/**
* @since 4.0.0
*/
public static function imagePath( $app, $image ) {
- return(\OC_Helper::imagePath( $app, $image ));
+ return \OC::$server->getURLGenerator()->imagePath($app, $image);
}
/**