diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-01 07:24:57 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-01 07:24:57 +0100 |
commit | 3adb6ae0f50e1a2beee6be889397ffcf2bf45354 (patch) | |
tree | ab27164f0b5cfc8aa11234501232a3fd5d08bc5a /lib/public | |
parent | 52d217d77519ed95a18237b09a351f83a0ae7f47 (diff) | |
parent | 2a0cda74d41ece6bee48024dd485bf08087054ad (diff) | |
download | nextcloud-server-3adb6ae0f50e1a2beee6be889397ffcf2bf45354.tar.gz nextcloud-server-3adb6ae0f50e1a2beee6be889397ffcf2bf45354.zip |
Merge pull request #22707 from owncloud/use-our-public-api
Use IQueryBuilder::PARAM_* instead of \PDO::PARAM_*
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/appframework/db/mapper.php | 2 | ||||
-rw-r--r-- | lib/public/db/querybuilder/iquerybuilder.php | 12 | ||||
-rw-r--r-- | lib/public/idbconnection.php | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/lib/public/appframework/db/mapper.php b/lib/public/appframework/db/mapper.php index 065a9f01ea1..56808997323 100644 --- a/lib/public/appframework/db/mapper.php +++ b/lib/public/appframework/db/mapper.php @@ -202,7 +202,7 @@ abstract class Mapper { /** * Returns the correct PDO constant based on the value type * @param $value - * @return PDO constant + * @return int PDO constant * @since 8.1.0 */ private function getPDOType($value) { diff --git a/lib/public/db/querybuilder/iquerybuilder.php b/lib/public/db/querybuilder/iquerybuilder.php index 5a020f4f6a2..444910a9c5a 100644 --- a/lib/public/db/querybuilder/iquerybuilder.php +++ b/lib/public/db/querybuilder/iquerybuilder.php @@ -156,7 +156,7 @@ interface IQueryBuilder { * * @param string|integer $key The parameter position or name. * @param mixed $value The parameter value. - * @param string|null $type One of the PDO::PARAM_* constants. + * @param string|null $type One of the IQueryBuilder::PARAM_* constants. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. * @since 8.2.0 @@ -780,7 +780,7 @@ interface IQueryBuilder { * @return IParameter * @since 8.2.0 */ - public function createNamedParameter($value, $type = \PDO::PARAM_STR, $placeHolder = null); + public function createNamedParameter($value, $type = self::PARAM_STR, $placeHolder = null); /** * Creates a new positional parameter and bind the given value to it. @@ -795,8 +795,8 @@ interface IQueryBuilder { * $qb = $conn->getQueryBuilder(); * $qb->select('u.*') * ->from('users', 'u') - * ->where('u.username = ' . $qb->createPositionalParameter('Foo', PDO::PARAM_STR)) - * ->orWhere('u.username = ' . $qb->createPositionalParameter('Bar', PDO::PARAM_STR)) + * ->where('u.username = ' . $qb->createPositionalParameter('Foo', IQueryBuilder::PARAM_STR)) + * ->orWhere('u.username = ' . $qb->createPositionalParameter('Bar', IQueryBuilder::PARAM_STR)) * </code> * * @param mixed $value @@ -805,7 +805,7 @@ interface IQueryBuilder { * @return IParameter * @since 8.2.0 */ - public function createPositionalParameter($value, $type = \PDO::PARAM_STR); + public function createPositionalParameter($value, $type = self::PARAM_STR); /** * Creates a new parameter @@ -816,7 +816,7 @@ interface IQueryBuilder { * $qb->select('u.*') * ->from('users', 'u') * ->where('u.username = ' . $qb->createParameter('name')) - * ->setParameter('name', 'Bar', PDO::PARAM_STR)) + * ->setParameter('name', 'Bar', IQueryBuilder::PARAM_STR)) * </code> * * @param string $name diff --git a/lib/public/idbconnection.php b/lib/public/idbconnection.php index c5767e65a82..ebfc95a3d38 100644 --- a/lib/public/idbconnection.php +++ b/lib/public/idbconnection.php @@ -32,6 +32,7 @@ // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; +use OCP\DB\QueryBuilder\IQueryBuilder; /** * Interface IDBConnection @@ -193,7 +194,7 @@ interface IDBConnection { * @return string The quoted parameter. * @since 8.0.0 */ - public function quote($input, $type = \PDO::PARAM_STR); + public function quote($input, $type = IQueryBuilder::PARAM_STR); /** * Gets the DatabasePlatform instance that provides all the metadata about |