/**
* Returns the number of columns of a statement
*
- * @param object Statement object
+ * @param object $stmt Statement object
* @return int Number of columns
*/
public static function columnCount($stmt): int
/**
* Returns the number of rows of a statement
*
- * @param PDOStatement|mysqli_result|mysqli_stmt Statement object
+ * @param PDOStatement|mysqli_result|mysqli_stmt $stmt Statement object
* @return int Number of rows
*/
public static function numRows($stmt): int
* @return boolean was the delete successful?
* @throws \Exception
*/
- public static function delete(string $table, array $conditions, array $options = []): bool
+ public static function delete(string $table, array $conditions): bool
{
- return DI::dba()->delete($table, $conditions, $options);
+ return DI::dba()->delete($table, $conditions);
}
/**
/**
* Returns the error number of the last query
*
- * @return string Error number (0 if no error)
+ * @return int Error number (0 if no error)
*/
public static function errorNo(): int
{
/**
* Acquire a lock to prevent a table optimization
*
- * @return bool
- * @throws LockPersistenceException
+ * @return bool
+ * @throws LockPersistenceException
*/
public static function acquireOptimizeLock(): bool
{
/**
* Release the table optimization lock
- * @return bool
- * @throws LockPersistenceException
+ * @return bool
+ * @throws LockPersistenceException
*/
public static function releaseOptimizeLock(): bool
{
break;
}
- /** @var $stmt mysqli_stmt|PDOStatement */
- if (!$stmt = $this->connection->prepare($sql)) {
+ /** @var mysqli_stmt|PDOStatement $stmt */
+ $stmt = $this->connection->prepare($sql);
+
+ if (!$stmt) {
$errorInfo = $this->connection->errorInfo();
$this->error = (string)$errorInfo[2];
$this->errorno = (int)$errorInfo[1];
/**
* Returns the number of columns of a statement
*
- * @param object Statement object
+ * @param object $stmt Statement object
*
* @return int Number of columns
*/
/**
* Returns the number of rows of a statement
*
- * @param PDOStatement|mysqli_result|mysqli_stmt Statement object
+ * @param PDOStatement|mysqli_result|mysqli_stmt $stmt Statement object
*
* @return int Number of rows
*/
/**
* Returns the error number of the last query
*
- * @return string Error number (0 if no error)
+ * @return int Error number (0 if no error)
*/
public function errorNo(): int
{
* @throws \Exception
* @see \Friendica\Database\DBA::delete
*/
- public static function delete(array $conditions, array $options = []): bool
+ public static function delete(array $conditions): bool
{
// get items to delete data info
$items = self::selectToArray(['backend-class', 'backend-ref'], $conditions);
}
}
- return DBA::delete('attach', $conditions, $options);
+ return DBA::delete('attach', $conditions);
}
public static function setPermissionFromBody(array $post)
* @throws \Exception
* @see \Friendica\Database\DBA::delete
*/
- public static function delete(array $conditions, array $options = []): bool
+ public static function delete(array $conditions): bool
{
// get photo to delete data info
$photos = DBA::select('photo', ['id', 'backend-class', 'backend-ref'], $conditions);
DBA::close($photos);
- return DBA::delete('photo', $conditions, $options);
+ return DBA::delete('photo', $conditions);
}
/**
* @return boolean was the delete successful?
* @throws \Exception
*/
- public static function delete(array $conditions, array $options = []): bool
+ public static function delete(array $conditions): bool
{
- return DBA::delete('post', $conditions, $options);
+ return DBA::delete('post', $conditions);
}
}
* Delete a row from the post-content table
*
* @param array $conditions Field condition(s)
- * @param array $options
- * - cascade: If true we delete records in other tables that depend on the one we're deleting through
- * relations (default: true)
*
* @return boolean was the delete successful?
* @throws \Exception
*/
- public static function delete(array $conditions, array $options = [])
+ public static function delete(array $conditions)
{
- return DBA::delete('post-content', $conditions, $options);
+ return DBA::delete('post-content', $conditions);
}
* Delete a row from the post-origin table
*
* @param array $conditions Field condition(s)
- * @param array $options
- * - cascade: If true we delete records in other tables that depend on the one we're deleting through
- * relations (default: true)
*
* @return boolean was the delete successful?
* @throws \Exception
*/
- public static function delete(array $conditions, array $options = [])
+ public static function delete(array $conditions)
{
- return DBA::delete('post-origin', $conditions, $options);
+ return DBA::delete('post-origin', $conditions);
}
}
* Delete a row from the post-thread table
*
* @param array $conditions Field condition(s)
- * @param array $options
- * - cascade: If true we delete records in other tables that depend on the one we're deleting through
- * relations (default: true)
*
* @return boolean was the delete successful?
* @throws \Exception
*/
- public static function delete(array $conditions, array $options = [])
+ public static function delete(array $conditions)
{
- return DBA::delete('post-thread', $conditions, $options);
+ return DBA::delete('post-thread', $conditions);
}
}
* @return boolean was the delete successful?
* @throws \Exception
*/
- public static function delete(array $conditions, array $options = [])
+ public static function delete(array $conditions)
{
- return DBA::delete('post-thread-user', $conditions, $options);
+ return DBA::delete('post-thread-user', $conditions);
}
/**
* Delete a row from the post-user table
*
* @param array $conditions Field condition(s)
- * @param array $options
- * - cascade: If true we delete records in other tables that depend on the one we're deleting through
- * relations (default: true)
*
* @return boolean was the delete successful?
* @throws \Exception
*/
- public static function delete(array $conditions, array $options = [])
+ public static function delete(array $conditions)
{
- return DBA::delete('post-user', $conditions, $options);
+ return DBA::delete('post-user', $conditions);
}
}
* Delete a row from the post-user-notification table
*
* @param array $conditions Field condition(s)
- * @param array $options - cascade: If true we delete records in other tables that depend on the one we're deleting through
- * relations (default: true)
*
* @return boolean was the deletion successful?
* @throws Exception
*/
- public static function delete(array $conditions, array $options = []): bool
+ public static function delete(array $conditions): bool
{
- return DBA::delete('post-user-notification', $conditions, $options);
+ return DBA::delete('post-user-notification', $conditions);
}
/**