Fix use statements

This commit is contained in:
Joas Schilling 2015-11-30 10:12:15 +01:00
parent 6816b36cdb
commit aa1a0a15ea
3 changed files with 25 additions and 21 deletions

View File

@ -21,9 +21,9 @@
namespace OC\SystemTag;
use \OCP\IDBConnection;
use OCP\SystemTag\ISystemTag;
class SystemTag implements \OCP\SystemTag\ISystemTag {
class SystemTag implements ISystemTag {
/**
* @var string

View File

@ -21,13 +21,14 @@
namespace OC\SystemTag;
use \OCP\IDBConnection;
use \OCP\SystemTag\TagNotFoundException;
use \OCP\SystemTag\TagAlreadyExistsException;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OCP\IDBConnection;
use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\TagAlreadyExistsException;
use OCP\SystemTag\TagNotFoundException;
use \Doctrine\DBAL\Exception\UniqueConstraintViolationException;
class SystemTagManager implements \OCP\SystemTag\ISystemTagManager {
class SystemTagManager implements ISystemTagManager {
const TAG_TABLE = 'systemtag';
@ -83,7 +84,7 @@ class SystemTagManager implements \OCP\SystemTag\ISystemTagManager {
->addOrderBy('name', 'ASC')
->addOrderBy('visibility', 'ASC')
->addOrderBy('editable', 'ASC')
->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY);
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY);
$result = $query->execute();
while ($row = $result->fetch()) {
@ -243,13 +244,13 @@ class SystemTagManager implements \OCP\SystemTag\ISystemTagManager {
$query = $this->connection->getQueryBuilder();
$query->delete(SystemTagObjectMapper::RELATION_TABLE)
->where($query->expr()->in('systemtagid', $query->createParameter('tagids')))
->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY)
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY)
->execute();
$query = $this->connection->getQueryBuilder();
$query->delete(self::TAG_TABLE)
->where($query->expr()->in('id', $query->createParameter('tagids')))
->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY);
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY);
if ($query->execute() === 0) {
throw new TagNotFoundException(

View File

@ -21,12 +21,15 @@
namespace OC\SystemTag;
use \OCP\SystemTag\ISystemTagManager;
use \OCP\IDBConnection;
use \OCP\SystemTag\TagNotFoundException;
use \Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OCP\IDBConnection;
use OCP\SystemTag\ISystemTag;
use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\ISystemTagObjectMapper;
use OCP\SystemTag\TagNotFoundException;
class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper {
class SystemTagObjectMapper implements ISystemTagObjectMapper {
const RELATION_TABLE = 'systemtag_object_mapping';
@ -64,7 +67,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper {
->from(self::RELATION_TABLE)
->where($query->expr()->in('objectid', $query->createParameter('objectids')))
->andWhere($query->expr()->eq('objecttype', $query->createParameter('objecttype')))
->setParameter('objectids', $objIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY)
->setParameter('objectids', $objIds, Connection::PARAM_INT_ARRAY)
->setParameter('objecttype', $objectType)
->addOrderBy('objectid', 'ASC')
->addOrderBy('systemtagid', 'ASC');
@ -100,7 +103,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper {
->from(self::RELATION_TABLE)
->where($query->expr()->in('systemtagid', $query->createParameter('tagids')))
->andWhere($query->expr()->eq('objecttype', $query->createParameter('objecttype')))
->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY)
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY)
->setParameter('objecttype', $objectType);
$objectIds = [];
@ -158,7 +161,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper {
->andWhere($query->expr()->in('systemtagid', $query->createParameter('tagids')))
->setParameter('objectid', $objId)
->setParameter('objecttype', $objectType)
->setParameter('tagids', $tagIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY)
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY)
->execute();
}
@ -174,7 +177,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper {
->where($query->expr()->in('objectid', $query->createParameter('objectids')))
->andWhere($query->expr()->eq('objecttype', $query->createParameter('objecttype')))
->andWhere($query->expr()->eq('systemtagid', $query->createParameter('tagid')))
->setParameter('objectids', $objIds, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY)
->setParameter('objectids', $objIds, Connection::PARAM_INT_ARRAY)
->setParameter('tagid', $tagId)
->setParameter('objecttype', $objectType)
->setMaxResults(1);
@ -201,7 +204,7 @@ class SystemTagObjectMapper implements \OCP\SystemTag\ISystemTagObjectMapper {
if (count($tags) !== count($tagIds)) {
// at least one tag missing, bail out
$foundTagIds = array_map(
function($tag) {
function(ISystemTag $tag) {
return $tag->getId();
},
$tags