mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 15:02:22 +01:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
522863116a | ||
|
|
b44774285b | ||
|
|
bc37f75b41 | ||
|
|
191a5366b1 | ||
|
|
44dddb2eee | ||
|
|
0c0c61c51b | ||
|
|
cc28fed9f5 | ||
|
|
b13564c6c0 | ||
|
|
d18126aac5 | ||
|
|
b7fd8241cf | ||
|
|
2432939e4f | ||
|
|
93ce84fa6e | ||
|
|
1bf4603422 | ||
|
|
e6961bd968 | ||
|
|
25d5bc5b46 | ||
|
|
cfc0655a1c | ||
|
|
6cde337777 |
@@ -35,17 +35,23 @@
|
||||
"slug": "3.0",
|
||||
"maintained": false
|
||||
},
|
||||
{
|
||||
"name": "2.21",
|
||||
"branchName": "2.21.x",
|
||||
"slug": "2.21",
|
||||
"upcoming": true
|
||||
},
|
||||
{
|
||||
"name": "2.20",
|
||||
"branchName": "2.20.x",
|
||||
"slug": "2.20",
|
||||
"upcoming": true
|
||||
"maintained": true
|
||||
},
|
||||
{
|
||||
"name": "2.19",
|
||||
"branchName": "2.19.x",
|
||||
"slug": "2.19",
|
||||
"maintained": true
|
||||
"maintained": false
|
||||
},
|
||||
{
|
||||
"name": "2.18",
|
||||
|
||||
2
.github/workflows/coding-standards.yml
vendored
2
.github/workflows/coding-standards.yml
vendored
@@ -24,4 +24,4 @@ on:
|
||||
|
||||
jobs:
|
||||
coding-standards:
|
||||
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.0.1"
|
||||
uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.1.0"
|
||||
|
||||
43
.github/workflows/documentation.yml
vendored
43
.github/workflows/documentation.yml
vendored
@@ -5,45 +5,16 @@ on:
|
||||
branches:
|
||||
- "*.x"
|
||||
paths:
|
||||
- .github/workflows/documentation.yml
|
||||
- docs/**
|
||||
- ".github/workflows/documentation.yml"
|
||||
- "docs/**"
|
||||
push:
|
||||
branches:
|
||||
- "*.x"
|
||||
paths:
|
||||
- .github/workflows/documentation.yml
|
||||
- docs/**
|
||||
- ".github/workflows/documentation.yml"
|
||||
- "docs/**"
|
||||
|
||||
jobs:
|
||||
validate-with-guides:
|
||||
name: "Validate documentation with phpDocumentor/guides"
|
||||
runs-on: "ubuntu-22.04"
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: "actions/checkout@v4"
|
||||
|
||||
- name: "Install PHP"
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
coverage: "none"
|
||||
php-version: "8.3"
|
||||
|
||||
- name: "Remove existing composer file"
|
||||
run: "rm composer.json"
|
||||
|
||||
- name: "Require phpdocumentor/guides-cli"
|
||||
run: "composer require --dev phpdocumentor/guides-cli --no-update"
|
||||
|
||||
- name: "Install dependencies with Composer"
|
||||
uses: "ramsey/composer-install@v3"
|
||||
with:
|
||||
dependency-versions: "highest"
|
||||
|
||||
- name: "Add orphan metadata where needed"
|
||||
run: |
|
||||
printf '%s\n\n%s\n' ":orphan:" "$(cat docs/en/sidebar.rst)" > docs/en/sidebar.rst
|
||||
printf '%s\n\n%s\n' ":orphan:" "$(cat docs/en/reference/installation.rst)" > docs/en/reference/installation.rst
|
||||
|
||||
- name: "Run guides-cli"
|
||||
run: "vendor/bin/guides -vvv --no-progress docs/en 2>&1 | grep -v 'No template found for rendering directive' | ( ! grep WARNING )"
|
||||
documentation:
|
||||
name: "Documentation"
|
||||
uses: "doctrine/.github/.github/workflows/documentation.yml@5.1.0"
|
||||
|
||||
@@ -7,7 +7,7 @@ on:
|
||||
|
||||
jobs:
|
||||
release:
|
||||
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.0.1"
|
||||
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.1.0"
|
||||
secrets:
|
||||
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
|
||||
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
"require-dev": {
|
||||
"doctrine/coding-standard": "^12.0",
|
||||
"phpbench/phpbench": "^1.0",
|
||||
"phpstan/phpstan": "1.11.1",
|
||||
"phpdocumentor/guides-cli": "^1.4",
|
||||
"phpstan/phpstan": "1.12.6",
|
||||
"phpunit/phpunit": "^10.4.0",
|
||||
"psr/log": "^1 || ^2 || ^3",
|
||||
"squizlabs/php_codesniffer": "3.7.2",
|
||||
|
||||
@@ -15,7 +15,7 @@ Index
|
||||
- :ref:`#[AttributeOverride] <attrref_attributeoverride>`
|
||||
- :ref:`#[Column] <attrref_column>`
|
||||
- :ref:`#[Cache] <attrref_cache>`
|
||||
- :ref:`#[ChangeTrackingPolicy <attrref_changetrackingpolicy>`
|
||||
- :ref:`#[ChangeTrackingPolicy] <attrref_changetrackingpolicy>`
|
||||
- :ref:`#[CustomIdGenerator] <attrref_customidgenerator>`
|
||||
- :ref:`#[DiscriminatorColumn] <attrref_discriminatorcolumn>`
|
||||
- :ref:`#[DiscriminatorMap] <attrref_discriminatormap>`
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
:orphan:
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
|
||||
@@ -1,80 +1,73 @@
|
||||
.. toc::
|
||||
:orphan:
|
||||
|
||||
.. tocheader:: Tutorials
|
||||
.. toctree::
|
||||
:caption: Tutorials
|
||||
:depth: 3
|
||||
|
||||
.. toctree::
|
||||
:depth: 3
|
||||
tutorials/getting-started
|
||||
tutorials/getting-started-database
|
||||
tutorials/getting-started-models
|
||||
tutorials/working-with-indexed-associations
|
||||
tutorials/extra-lazy-associations
|
||||
tutorials/composite-primary-keys
|
||||
tutorials/ordered-associations
|
||||
tutorials/override-field-association-mappings-in-subclasses
|
||||
tutorials/pagination
|
||||
tutorials/embeddables
|
||||
|
||||
tutorials/getting-started
|
||||
tutorials/getting-started-database
|
||||
tutorials/getting-started-models
|
||||
tutorials/working-with-indexed-associations
|
||||
tutorials/extra-lazy-associations
|
||||
tutorials/composite-primary-keys
|
||||
tutorials/ordered-associations
|
||||
tutorials/override-field-association-mappings-in-subclasses
|
||||
tutorials/pagination
|
||||
tutorials/embeddables
|
||||
.. toctree::
|
||||
:caption: Reference
|
||||
:depth: 3
|
||||
|
||||
.. toc::
|
||||
reference/architecture
|
||||
reference/configuration
|
||||
reference/faq
|
||||
reference/basic-mapping
|
||||
reference/association-mapping
|
||||
reference/inheritance-mapping
|
||||
reference/working-with-objects
|
||||
reference/working-with-associations
|
||||
reference/typedfieldmapper
|
||||
reference/events
|
||||
reference/unitofwork
|
||||
reference/unitofwork-associations
|
||||
reference/transactions-and-concurrency
|
||||
reference/batch-processing
|
||||
reference/dql-doctrine-query-language
|
||||
reference/query-builder
|
||||
reference/native-sql
|
||||
reference/change-tracking-policies
|
||||
reference/attributes-reference
|
||||
reference/xml-mapping
|
||||
reference/php-mapping
|
||||
reference/caching
|
||||
reference/improving-performance
|
||||
reference/tools
|
||||
reference/metadata-drivers
|
||||
reference/best-practices
|
||||
reference/limitations-and-known-issues
|
||||
tutorials/pagination
|
||||
reference/filters
|
||||
reference/namingstrategy
|
||||
reference/advanced-configuration
|
||||
reference/second-level-cache
|
||||
reference/security
|
||||
|
||||
.. tocheader:: Reference
|
||||
.. toctree::
|
||||
:caption: Cookbook
|
||||
:depth: 3
|
||||
|
||||
.. toctree::
|
||||
:depth: 3
|
||||
|
||||
reference/architecture
|
||||
reference/configuration
|
||||
reference/faq
|
||||
reference/basic-mapping
|
||||
reference/association-mapping
|
||||
reference/inheritance-mapping
|
||||
reference/working-with-objects
|
||||
reference/working-with-associations
|
||||
reference/typedfieldmapper
|
||||
reference/events
|
||||
reference/unitofwork
|
||||
reference/unitofwork-associations
|
||||
reference/transactions-and-concurrency
|
||||
reference/batch-processing
|
||||
reference/dql-doctrine-query-language
|
||||
reference/query-builder
|
||||
reference/native-sql
|
||||
reference/change-tracking-policies
|
||||
reference/attributes-reference
|
||||
reference/xml-mapping
|
||||
reference/php-mapping
|
||||
reference/caching
|
||||
reference/improving-performance
|
||||
reference/tools
|
||||
reference/metadata-drivers
|
||||
reference/best-practices
|
||||
reference/limitations-and-known-issues
|
||||
tutorials/pagination
|
||||
reference/filters
|
||||
reference/namingstrategy
|
||||
reference/advanced-configuration
|
||||
reference/second-level-cache
|
||||
reference/security
|
||||
|
||||
.. toc::
|
||||
|
||||
.. tocheader:: Cookbook
|
||||
|
||||
.. toctree::
|
||||
:depth: 3
|
||||
|
||||
cookbook/aggregate-fields
|
||||
cookbook/custom-mapping-types
|
||||
cookbook/decorator-pattern
|
||||
cookbook/dql-custom-walkers
|
||||
cookbook/dql-user-defined-functions
|
||||
cookbook/implementing-arrayaccess-for-domain-objects
|
||||
cookbook/resolve-target-entity-listener
|
||||
cookbook/sql-table-prefixes
|
||||
cookbook/strategy-cookbook-introduction
|
||||
cookbook/validation-of-entities
|
||||
cookbook/working-with-datetime
|
||||
cookbook/mysql-enums
|
||||
cookbook/advanced-field-value-conversion-using-custom-mapping-types
|
||||
cookbook/entities-in-session
|
||||
cookbook/aggregate-fields
|
||||
cookbook/custom-mapping-types
|
||||
cookbook/decorator-pattern
|
||||
cookbook/dql-custom-walkers
|
||||
cookbook/dql-user-defined-functions
|
||||
cookbook/implementing-arrayaccess-for-domain-objects
|
||||
cookbook/resolve-target-entity-listener
|
||||
cookbook/sql-table-prefixes
|
||||
cookbook/strategy-cookbook-introduction
|
||||
cookbook/validation-of-entities
|
||||
cookbook/working-with-datetime
|
||||
cookbook/mysql-enums
|
||||
cookbook/advanced-field-value-conversion-using-custom-mapping-types
|
||||
cookbook/entities-in-session
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Performance;
|
||||
|
||||
use Doctrine\DBAL\Cache\ArrayResult;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver\PDO\SQLite\Driver;
|
||||
use Doctrine\DBAL\Result;
|
||||
|
||||
final class ArrayResultFactory
|
||||
{
|
||||
public static function createFromArray(array $resultSet): Result
|
||||
{
|
||||
return new Result(new ArrayResult($resultSet), new Connection([], new Driver()));
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ declare(strict_types=1);
|
||||
namespace Doctrine\Performance;
|
||||
|
||||
use Doctrine\Common\EventManager;
|
||||
use Doctrine\DBAL\Cache\ArrayResult;
|
||||
use Doctrine\DBAL\Cache\QueryCacheProfile;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver\PDO\SQLite\Driver;
|
||||
@@ -17,6 +16,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Mapping\Driver\AttributeDriver;
|
||||
use Doctrine\ORM\Proxy\ProxyFactory;
|
||||
use Doctrine\ORM\Tools\SchemaTool;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\TestUtil;
|
||||
|
||||
use function array_map;
|
||||
@@ -67,7 +67,7 @@ final class EntityManagerFactory
|
||||
/** {@inheritDoc} */
|
||||
public function executeQuery(string $sql, array $params = [], $types = [], QueryCacheProfile|null $qcp = null): Result
|
||||
{
|
||||
return new Result(new ArrayResult([]), $this);
|
||||
return ArrayResultFactory::createWrapperResultFromArray([], $this);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Doctrine\Performance\Hydration;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\Internal\Hydration\ArrayHydrator;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use Doctrine\Performance\ArrayResultFactory;
|
||||
use Doctrine\Performance\EntityManagerFactory;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods;
|
||||
@@ -62,7 +62,7 @@ final class MixedQueryFetchJoinArrayHydrationPerformanceBench
|
||||
];
|
||||
}
|
||||
|
||||
$this->result = ArrayResultFactory::createFromArray($resultSet);
|
||||
$this->result = ArrayResultFactory::createWrapperResultFromArray($resultSet);
|
||||
$this->hydrator = new ArrayHydrator(EntityManagerFactory::getEntityManager([]));
|
||||
$this->rsm = new ResultSetMapping();
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Doctrine\Performance\Hydration;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\Internal\Hydration\ObjectHydrator;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use Doctrine\Performance\ArrayResultFactory;
|
||||
use Doctrine\Performance\EntityManagerFactory;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsPhonenumber;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
@@ -49,7 +49,7 @@ final class MixedQueryFetchJoinFullObjectHydrationPerformanceBench
|
||||
];
|
||||
}
|
||||
|
||||
$this->result = ArrayResultFactory::createFromArray($resultSet);
|
||||
$this->result = ArrayResultFactory::createWrapperResultFromArray($resultSet);
|
||||
$this->hydrator = new ObjectHydrator(EntityManagerFactory::getEntityManager([]));
|
||||
$this->rsm = new ResultSetMapping();
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Doctrine\Performance\Hydration;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\Internal\Hydration\ArrayHydrator;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use Doctrine\Performance\ArrayResultFactory;
|
||||
use Doctrine\Performance\EntityManagerFactory;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods;
|
||||
|
||||
@@ -53,7 +53,7 @@ final class SimpleQueryArrayHydrationPerformanceBench
|
||||
];
|
||||
}
|
||||
|
||||
$this->result = ArrayResultFactory::createFromArray($resultSet);
|
||||
$this->result = ArrayResultFactory::createWrapperResultFromArray($resultSet);
|
||||
$this->hydrator = new ArrayHydrator(EntityManagerFactory::getEntityManager([]));
|
||||
$this->rsm = new ResultSetMapping();
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Doctrine\Performance\Hydration;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\Internal\Hydration\ObjectHydrator;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use Doctrine\Performance\ArrayResultFactory;
|
||||
use Doctrine\Performance\EntityManagerFactory;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods;
|
||||
@@ -44,7 +44,7 @@ final class SimpleQueryFullObjectHydrationPerformanceBench
|
||||
];
|
||||
}
|
||||
|
||||
$this->result = ArrayResultFactory::createFromArray($resultSet);
|
||||
$this->result = ArrayResultFactory::createWrapperResultFromArray($resultSet);
|
||||
$this->hydrator = new ObjectHydrator(EntityManagerFactory::getEntityManager([]));
|
||||
$this->rsm = new ResultSetMapping();
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Doctrine\Performance\Hydration;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\Internal\Hydration\ScalarHydrator;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use Doctrine\Performance\ArrayResultFactory;
|
||||
use Doctrine\Performance\EntityManagerFactory;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\Models\CMS\CmsUser;
|
||||
use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods;
|
||||
|
||||
@@ -53,7 +53,7 @@ final class SimpleQueryScalarHydrationPerformanceBench
|
||||
];
|
||||
}
|
||||
|
||||
$this->result = ArrayResultFactory::createFromArray($resultSet);
|
||||
$this->result = ArrayResultFactory::createWrapperResultFromArray($resultSet);
|
||||
$this->hydrator = new ScalarHydrator(EntityManagerFactory::getEntityManager([]));
|
||||
$this->rsm = new ResultSetMapping();
|
||||
|
||||
|
||||
42
tests/Tests/Mocks/ArrayResultFactory.php
Normal file
42
tests/Tests/Mocks/ArrayResultFactory.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Tests\Mocks;
|
||||
|
||||
use Doctrine\DBAL\Cache\ArrayResult;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver\PDO\SQLite\Driver;
|
||||
use Doctrine\DBAL\Result;
|
||||
use ReflectionMethod;
|
||||
|
||||
use function array_keys;
|
||||
use function array_map;
|
||||
use function array_values;
|
||||
|
||||
final class ArrayResultFactory
|
||||
{
|
||||
/** @param list<array<string, mixed>> $resultSet */
|
||||
public static function createDriverResultFromArray(array $resultSet): ArrayResult
|
||||
{
|
||||
if ((new ReflectionMethod(ArrayResult::class, '__construct'))->getNumberOfRequiredParameters() < 2) {
|
||||
// DBAL < 4.2
|
||||
return new ArrayResult($resultSet);
|
||||
}
|
||||
|
||||
// DBAL 4.2+
|
||||
return new ArrayResult(
|
||||
array_keys($resultSet[0] ?? []),
|
||||
array_map(array_values(...), $resultSet),
|
||||
);
|
||||
}
|
||||
|
||||
/** @param list<array<string, mixed>> $resultSet */
|
||||
public static function createWrapperResultFromArray(array $resultSet, Connection|null $connection = null): Result
|
||||
{
|
||||
return new Result(
|
||||
self::createDriverResultFromArray($resultSet),
|
||||
$connection ?? new Connection([], new Driver()),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,7 @@ declare(strict_types=1);
|
||||
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Cache\ArrayResult;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\Internal\Hydration\ObjectHydrator;
|
||||
use Doctrine\ORM\Mapping\Column;
|
||||
use Doctrine\ORM\Mapping\DiscriminatorColumn;
|
||||
@@ -19,6 +17,7 @@ use Doctrine\ORM\Mapping\InheritanceType;
|
||||
use Doctrine\ORM\Mapping\ManyToOne;
|
||||
use Doctrine\ORM\Mapping\OneToMany;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
use PHPUnit\Framework\Attributes\Group;
|
||||
|
||||
@@ -78,7 +77,7 @@ final class GH6362Test extends OrmFunctionalTestCase
|
||||
],
|
||||
];
|
||||
|
||||
$stmt = new Result(new ArrayResult($resultSet), $this->createMock(Connection::class));
|
||||
$stmt = ArrayResultFactory::createWrapperResultFromArray($resultSet, $this->createMock(Connection::class));
|
||||
$hydrator = new ObjectHydrator($this->_em);
|
||||
$result = $hydrator->hydrateAll($stmt, $rsm);
|
||||
|
||||
|
||||
@@ -5,9 +5,7 @@ declare(strict_types=1);
|
||||
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Cache\ArrayResult;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\Internal\Hydration\ObjectHydrator;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\ORM\Mapping\Column;
|
||||
@@ -15,6 +13,7 @@ use Doctrine\ORM\Mapping\Entity;
|
||||
use Doctrine\ORM\Mapping\GeneratedValue;
|
||||
use Doctrine\ORM\Mapping\Id;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
final class GH9807Test extends OrmFunctionalTestCase
|
||||
@@ -63,7 +62,7 @@ final class GH9807Test extends OrmFunctionalTestCase
|
||||
],
|
||||
];
|
||||
|
||||
$stmt = new Result(new ArrayResult($resultSet), $this->createMock(Connection::class));
|
||||
$stmt = ArrayResultFactory::createWrapperResultFromArray($resultSet, $this->createMock(Connection::class));
|
||||
|
||||
/** @var GH9807Main[] $result */
|
||||
$result = $hydrator->hydrateAll($stmt, $rsm);
|
||||
|
||||
@@ -4,9 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Tests\ORM\Hydration;
|
||||
|
||||
use Doctrine\DBAL\Cache\ArrayResult;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\OrmTestCase;
|
||||
|
||||
class HydrationTestCase extends OrmTestCase
|
||||
@@ -22,6 +22,6 @@ class HydrationTestCase extends OrmTestCase
|
||||
|
||||
protected function createResultMock(array $resultSet): Result
|
||||
{
|
||||
return new Result(new ArrayResult($resultSet), $this->entityManager->getConnection());
|
||||
return ArrayResultFactory::createWrapperResultFromArray($resultSet, $this->entityManager->getConnection());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\Tests\ORM\Hydration;
|
||||
|
||||
use Doctrine\DBAL\Cache\ArrayResult;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\Internal\Hydration\HydrationException;
|
||||
use Doctrine\ORM\Internal\Hydration\ObjectHydrator;
|
||||
use Doctrine\ORM\Mapping\ClassMetadata;
|
||||
@@ -14,6 +12,7 @@ use Doctrine\ORM\PersistentCollection;
|
||||
use Doctrine\ORM\Proxy\InternalProxy;
|
||||
use Doctrine\ORM\Proxy\ProxyFactory;
|
||||
use Doctrine\ORM\Query\ResultSetMapping;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsArticle;
|
||||
use Doctrine\Tests\Models\CMS\CmsComment;
|
||||
@@ -1337,7 +1336,7 @@ class ObjectHydratorTest extends HydrationTestCase
|
||||
$hydrator = new ObjectHydrator($this->entityManager);
|
||||
$rowNum = 0;
|
||||
$iterableResult = $hydrator->toIterable(
|
||||
new Result(new ArrayResult($resultSet), $this->createMock(Connection::class)),
|
||||
ArrayResultFactory::createWrapperResultFromArray($resultSet, $this->createMock(Connection::class)),
|
||||
$rsm,
|
||||
);
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\DBAL\ArrayParameterType;
|
||||
use Doctrine\DBAL\Cache\ArrayResult;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Driver;
|
||||
use Doctrine\DBAL\Driver\Result;
|
||||
@@ -22,6 +21,7 @@ use Doctrine\ORM\Query\Parameter;
|
||||
use Doctrine\ORM\Query\QueryException;
|
||||
use Doctrine\ORM\UnitOfWork;
|
||||
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
|
||||
use Doctrine\Tests\Mocks\ArrayResultFactory;
|
||||
use Doctrine\Tests\Mocks\EntityManagerMock;
|
||||
use Doctrine\Tests\Models\CMS\CmsAddress;
|
||||
use Doctrine\Tests\Models\CMS\CmsGroup;
|
||||
@@ -361,10 +361,10 @@ class QueryTest extends OrmTestCase
|
||||
{
|
||||
$entityManager = $this->createTestEntityManagerWithConnection(
|
||||
$this->createConnection(
|
||||
new ArrayResult([
|
||||
ArrayResultFactory::createDriverResultFromArray([
|
||||
['id_0' => 1],
|
||||
]),
|
||||
new ArrayResult([]),
|
||||
ArrayResultFactory::createDriverResultFromArray([]),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -399,14 +399,14 @@ class QueryTest extends OrmTestCase
|
||||
{
|
||||
$entityManager = $this->createTestEntityManagerWithConnection(
|
||||
$this->createConnection(
|
||||
new ArrayResult([
|
||||
ArrayResultFactory::createDriverResultFromArray([
|
||||
['id_0' => 1],
|
||||
]),
|
||||
new ArrayResult([
|
||||
ArrayResultFactory::createDriverResultFromArray([
|
||||
['id_0' => 1],
|
||||
['id_0' => 2],
|
||||
]),
|
||||
new ArrayResult([
|
||||
ArrayResultFactory::createDriverResultFromArray([
|
||||
['id_0' => 1],
|
||||
]),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user