Replace other usages

This commit is contained in:
Joas Schilling 2016-01-25 17:17:36 +01:00
parent c5046fb2a9
commit 09ae160463
8 changed files with 25 additions and 21 deletions

View file

@ -22,6 +22,7 @@
namespace OCA\DAV\CalDAV;
use OCP\DB\QueryBuilder\IQueryBuilder;
use Sabre\CalDAV\Backend\AbstractBackend;
use Sabre\CalDAV\Backend\SchedulingSupport;
use Sabre\CalDAV\Backend\SubscriptionSupport;
@ -384,7 +385,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
->from('calendarobjects')
->where($query->expr()->eq('calendarid', $query->createNamedParameter($calendarId)))
->andWhere($query->expr()->in('uri', $query->createParameter('uri')))
->setParameter('uri', $uris, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY);
->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
$stmt = $query->execute();

View file

@ -25,6 +25,7 @@
namespace OCA\DAV\CardDAV;
use OCA\DAV\Connector\Sabre\Principal;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use Sabre\CardDAV\Backend\BackendInterface;
use Sabre\CardDAV\Backend\SyncSupport;
@ -118,7 +119,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
->where($query->expr()->in('s.principaluri', $query->createParameter('principaluri')))
->andWhere($query->expr()->eq('s.type', $query->createParameter('type')))
->setParameter('type', 'addressbook')
->setParameter('principaluri', $principals, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
->setParameter('principaluri', $principals, IQueryBuilder::PARAM_STR_ARRAY)
->execute();
while($row = $result->fetch()) {
@ -423,7 +424,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
->from('cards')
->where($query->expr()->eq('addressbookid', $query->createNamedParameter($addressBookId)))
->andWhere($query->expr()->in('uri', $query->createParameter('uri')))
->setParameter('uri', $uris, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY);
->setParameter('uri', $uris, IQueryBuilder::PARAM_STR_ARRAY);
$cards = [];

View file

@ -24,6 +24,7 @@ namespace OC\Repair;
use OC\Hooks\BasicEmitter;
use OC\RepairStep;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
/**
@ -134,7 +135,7 @@ class CleanTags extends BasicEmitter implements RepairStep {
$qb->expr()->eq('type', $qb->expr()->literal('files'))
)
->andWhere($qb->expr()->in($deleteId, $qb->createParameter('ids')));
$qb->setParameter('ids', $items, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY);
$qb->setParameter('ids', $items, IQueryBuilder::PARAM_INT_ARRAY);
$qb->execute();
}
}

View file

@ -38,6 +38,7 @@
namespace OC\Share;
use OC\Files\Filesystem;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IUserSession;
use OCP\IDBConnection;
use OCP\IConfig;
@ -426,7 +427,7 @@ class Share extends Constants {
if (!empty($groups)) {
$where = $fileDependentWhere . ' WHERE `' . $column . '` = ? AND `item_type` = ? AND `share_with` in (?)';
$arguments = array($itemSource, $itemType, $groups);
$types = array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY);
$types = array(null, null, IQueryBuilder::PARAM_STR_ARRAY);
if ($owner !== null) {
$where .= ' AND `uid_owner` = ?';

View file

@ -24,6 +24,7 @@ use OC\Share20\Exception\InvalidShare;
use OC\Share20\Exception\ProviderException;
use OC\Share20\Exception\ShareNotFound;
use OC\Share20\Exception\BackendError;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\NotFoundException;
use OCP\IGroup;
use OCP\IUser;
@ -33,8 +34,6 @@ use OCP\Files\IRootFolder;
use OCP\IDBConnection;
use OCP\Files\Node;
use Doctrine\DBAL\Connection;
/**
* Class DefaultShareProvider
*
@ -520,7 +519,7 @@ class DefaultShareProvider implements IShareProvider {
$qb->where($qb->expr()->eq('share_type', $qb->createNamedParameter(\OCP\Share::SHARE_TYPE_GROUP)));
$qb->andWhere($qb->expr()->in('share_with', $qb->createNamedParameter(
$groups,
Connection::PARAM_STR_ARRAY
IQueryBuilder::PARAM_STR_ARRAY
)));
$cursor = $qb->execute();
@ -697,4 +696,4 @@ class DefaultShareProvider implements IShareProvider {
return $share;
}
}
}

View file

@ -22,8 +22,8 @@
namespace OC\SystemTag;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\TagAlreadyExistsException;
@ -85,7 +85,7 @@ class SystemTagManager implements ISystemTagManager {
->addOrderBy('name', 'ASC')
->addOrderBy('visibility', 'ASC')
->addOrderBy('editable', 'ASC')
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY);
->setParameter('tagids', $tagIds, IQueryBuilder::PARAM_INT_ARRAY);
$result = $query->execute();
while ($row = $result->fetch()) {
@ -252,13 +252,13 @@ class SystemTagManager implements ISystemTagManager {
$query = $this->connection->getQueryBuilder();
$query->delete(SystemTagObjectMapper::RELATION_TABLE)
->where($query->expr()->in('systemtagid', $query->createParameter('tagids')))
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY)
->setParameter('tagids', $tagIds, IQueryBuilder::PARAM_INT_ARRAY)
->execute();
$query = $this->connection->getQueryBuilder();
$query->delete(self::TAG_TABLE)
->where($query->expr()->in('id', $query->createParameter('tagids')))
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY)
->setParameter('tagids', $tagIds, IQueryBuilder::PARAM_INT_ARRAY)
->execute();
if ($tagNotFoundException !== null) {

View file

@ -22,8 +22,8 @@
namespace OC\SystemTag;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\SystemTag\ISystemTag;
use OCP\SystemTag\ISystemTagManager;
@ -68,7 +68,7 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
->from(self::RELATION_TABLE)
->where($query->expr()->in('objectid', $query->createParameter('objectids')))
->andWhere($query->expr()->eq('objecttype', $query->createParameter('objecttype')))
->setParameter('objectids', $objIds, Connection::PARAM_INT_ARRAY)
->setParameter('objectids', $objIds, IQueryBuilder::PARAM_INT_ARRAY)
->setParameter('objecttype', $objectType)
->addOrderBy('objectid', 'ASC')
->addOrderBy('systemtagid', 'ASC');
@ -104,7 +104,7 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
->from(self::RELATION_TABLE)
->where($query->expr()->in('systemtagid', $query->createParameter('tagids')))
->andWhere($query->expr()->eq('objecttype', $query->createParameter('objecttype')))
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY)
->setParameter('tagids', $tagIds, IQueryBuilder::PARAM_INT_ARRAY)
->setParameter('objecttype', $objectType);
$objectIds = [];
@ -162,7 +162,7 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
->andWhere($query->expr()->in('systemtagid', $query->createParameter('tagids')))
->setParameter('objectid', $objId)
->setParameter('objecttype', $objectType)
->setParameter('tagids', $tagIds, Connection::PARAM_INT_ARRAY)
->setParameter('tagids', $tagIds, IQueryBuilder::PARAM_INT_ARRAY)
->execute();
}
@ -191,7 +191,7 @@ class SystemTagObjectMapper implements 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, Connection::PARAM_INT_ARRAY)
->setParameter('objectids', $objIds, IQueryBuilder::PARAM_INT_ARRAY)
->setParameter('tagid', $tagId)
->setParameter('objecttype', $objectType);

View file

@ -41,8 +41,9 @@
namespace OC;
use \OC\Tagging\Tag;
use \OC\Tagging\TagMapper;
use OC\Tagging\Tag;
use OC\Tagging\TagMapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
class Tags implements \OCP\ITags {
@ -223,7 +224,7 @@ class Tags implements \OCP\ITags {
'FROM `' . self::RELATION_TABLE . '` r, `' . self::TAG_TABLE . '` ' .
'WHERE `categoryid` = `id` AND `uid` = ? AND r.`type` = ? AND `objid` IN (?)',
array($this->user, $this->type, $chunk),
array(null, null, \Doctrine\DBAL\Connection::PARAM_INT_ARRAY)
array(null, null, IQueryBuilder::PARAM_INT_ARRAY)
);
while ($row = $result->fetch()) {
$objId = (int)$row['objid'];