diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-29 09:44:40 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-29 09:44:40 +0100 |
commit | 2a0cda74d41ece6bee48024dd485bf08087054ad (patch) | |
tree | 8c3e8b30d3db45d3c17de189188f15aa7062cf81 /lib/public | |
parent | 6526c122afa2c141f4cd5ffd7e292f7a5556cf61 (diff) | |
download | nextcloud-server-2a0cda74d41ece6bee48024dd485bf08087054ad.tar.gz nextcloud-server-2a0cda74d41ece6bee48024dd485bf08087054ad.zip |
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 |