lib/private/Tags.php
/**
	* Delete tag/object relations from the db
	*
	* @param array $ids The ids of the objects
	* @return boolean Returns false on error.
	*/
Delete tag/object relations from the db
@param array $ids The ids of the objects
@return boolean Returns false on error.
Delete tag / object relations from the db @param array $ids The ids of the objects @return boolean Returns false on error .
public function purgeObjects(array $ids) {
		if(count($ids) === 0) {
			return true;
		}
		$updates = $ids;
		try {
			$query = 'DELETE FROM `' . self::RELATION_TABLE . '` ';
			$query .= 'WHERE `objid` IN (' . str_repeat('?,', count($ids)-1) . '?) ';
			$query .= 'AND `type`= ?';
			$updates[] = $this->type;
			$stmt = \OCP\DB::prepare($query);
			$result = $stmt->execute($updates);
			if (\OCP\DB::isError($result)) {
				\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
				return false;
			}
		} catch(\Exception $e) {
			\OCP\Util::writeLog('core', __METHOD__.', exception: ' . $e->getMessage(),
				\OCP\Util::ERROR);
			return false;
		}
		return true;
	}
public function purgeObjects ( array $ ids ) { if ( count ( $ ids ) === 0 ) { return true ; } $ updates = $ ids ; try { $ query = 'DELETE FROM `' . self :: RELATION_TABLE . '` ' ; $ query .= 'WHERE `objid` IN (' . str_repeat ( '?,' , count ( $ ids ) - 1 ) . '?) ' ; $ query .= 'AND `type`= ?' ; $ updates [ ] = $ this -> type ; $ stmt = \ OCP \ DB :: prepare ( $ query ) ; $ result = $ stmt -> execute ( $ updates ) ; if ( \ OCP \ DB :: isError ( $ result ) ) { \ OCP \ Util :: writeLog ( 'core' , __METHOD__ . 'DB error: ' . \ OCP \ DB :: getErrorMessage ( ) , \ OCP \ Util :: ERROR ) ; return false ; } } catch ( \ Exception $ e ) { \ OCP \ Util :: writeLog ( 'core' , __METHOD__ . ', exception: ' . $ e -> getMessage ( ) , \ OCP \ Util :: ERROR ) ; return false ; } return true ; }
Delete tag/object relations from the db
 @param array $ids The ids of the objects
 @return boolean Returns false on error.
Delete tag / object relations from the db @param array $ids The ids of the objects @return boolean Returns false on error .
// job done ;)