Skip to content

Commit 0c5f7f3

Browse files
committed
Merge remote-tracking branch 'origin/1.3.x' into 1.4.x
2 parents 0d96737 + 45aa443 commit 0c5f7f3

10 files changed

+122
-1
lines changed

extension.neon

+5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ parameters:
1919
- Doctrine\ORM\Tools\Pagination\Paginator
2020
stubFiles:
2121
- stubs/Criteria.stub
22+
- stubs/DBAL/Cache/CacheException.stub
23+
- stubs/DBAL/Cache/QueryCacheProfile.stub
2224
- stubs/DBAL/Exception/UniqueConstraintViolationException.stub
25+
- stubs/DBAL/Types/Type.stub
26+
- stubs/DBAL/Exception.stub
27+
- stubs/DBAL/Result.stub
2328
- stubs/DocumentManager.stub
2429
- stubs/DocumentRepository.stub
2530
- stubs/EntityManager.stub

src/Stubs/Doctrine/StubFilesExtensionLoader.php

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function getFiles(): array
3535
}
3636

3737
$files = [
38+
$path . '/DBAL/Connection.stub',
3839
$path . '/ORM/QueryBuilder.stub',
3940
$path . '/EntityRepository.stub',
4041
];

stubs/DBAL/Cache/CacheException.stub

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Doctrine\DBAL\Cache;
4+
5+
use Doctrine\DBAL\Exception;
6+
7+
class CacheException extends Exception
8+
{
9+
10+
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Doctrine\DBAL\Cache;
4+
5+
class QueryCacheProfile
6+
{
7+
8+
}

stubs/DBAL/Connection.stub

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Doctrine\DBAL;
4+
5+
class Connection
6+
{
7+
8+
}

stubs/DBAL/Exception.stub

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Doctrine\DBAL;
4+
5+
class Exception extends \Exception
6+
{
7+
8+
}

stubs/DBAL/Exception/UniqueConstraintViolationException.stub

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace Doctrine\DBAL\Exception;
44

5-
class UniqueConstraintViolationException extends \Exception
5+
use Doctrine\DBAL\Exception;
6+
7+
class UniqueConstraintViolationException extends Exception
68
{
79

810
}

stubs/DBAL/Result.stub

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Doctrine\DBAL;
4+
5+
class Result
6+
{
7+
8+
}

stubs/DBAL/Types/Type.stub

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Doctrine\DBAL\Types;
4+
5+
abstract class Type
6+
{
7+
}
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
namespace Doctrine\DBAL;
4+
5+
use Doctrine\DBAL\Cache\CacheException;
6+
use Doctrine\DBAL\Cache\QueryCacheProfile;
7+
use Doctrine\DBAL\Types\Type;
8+
9+
class Connection
10+
{
11+
/**
12+
* Executes an SQL statement with the given parameters and returns the number of affected rows.
13+
*
14+
* Could be used for:
15+
* - DML statements: INSERT, UPDATE, DELETE, etc.
16+
* - DDL statements: CREATE, DROP, ALTER, etc.
17+
* - DCL statements: GRANT, REVOKE, etc.
18+
* - Session control statements: ALTER SESSION, SET, DECLARE, etc.
19+
* - Other statements that don't yield a row set.
20+
*
21+
* This method supports PDO binding types as well as DBAL mapping types.
22+
*
23+
* @param literal-string $sql SQL statement
24+
* @param list<mixed>|array<string, mixed> $params Statement parameters
25+
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
26+
*
27+
* @return int|string The number of affected rows.
28+
*
29+
* @throws Exception
30+
*/
31+
public function executeStatement($sql, array $params = [], array $types = []);
32+
33+
/**
34+
* Executes an, optionally parameterized, SQL query.
35+
*
36+
* If the query is parametrized, a prepared statement is used.
37+
* If an SQLLogger is configured, the execution is logged.
38+
*
39+
* @param literal-string $sql SQL query
40+
* @param list<mixed>|array<string, mixed> $params Query parameters
41+
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
42+
*
43+
* @throws Exception
44+
*/
45+
public function executeQuery(
46+
string $sql,
47+
array $params = [],
48+
$types = [],
49+
?QueryCacheProfile $qcp = null
50+
): Result;
51+
52+
/**
53+
* Executes a caching query.
54+
*
55+
* @param literal-string $sql SQL query
56+
* @param list<mixed>|array<string, mixed> $params Query parameters
57+
* @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types Parameter types
58+
*
59+
* @throws CacheException
60+
* @throws Exception
61+
*/
62+
public function executeCacheQuery($sql, $params, $types, QueryCacheProfile $qcp): Result;
63+
64+
}

0 commit comments

Comments
 (0)