diff options
| author | polo <ordipolo@gmx.fr> | 2026-10-18 00:08:23 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-10-18 00:10:03 +0200 |
| commit | 05e38eadbeb3de19e5b26003c2b401e00bb71df4 (patch) | |
| tree | cf48350b69cfce92de6f3a0e03eb0876931c7077 /vendor/doctrine/orm/src/Persisters/Collection/AbstractCollectionPersister.php | |
| parent | 32843e50aa981f190bdb4fbc9adbeacc06fdf775 (diff) | |
| download | AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.gz AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.tar.bz2 AppliGestionPHP-05e38eadbeb3de19e5b26003c2b401e00bb71df4.zip | |
sortie de vendor du dépôt, oubli dans config-template.ini
Diffstat (limited to 'vendor/doctrine/orm/src/Persisters/Collection/AbstractCollectionPersister.php')
| -rw-r--r-- | vendor/doctrine/orm/src/Persisters/Collection/AbstractCollectionPersister.php | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/vendor/doctrine/orm/src/Persisters/Collection/AbstractCollectionPersister.php b/vendor/doctrine/orm/src/Persisters/Collection/AbstractCollectionPersister.php deleted file mode 100644 index 26f0b9e..0000000 --- a/vendor/doctrine/orm/src/Persisters/Collection/AbstractCollectionPersister.php +++ /dev/null | |||
| @@ -1,50 +0,0 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Persisters\Collection; | ||
| 6 | |||
| 7 | use Doctrine\DBAL\Connection; | ||
| 8 | use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
| 9 | use Doctrine\ORM\EntityManagerInterface; | ||
| 10 | use Doctrine\ORM\Mapping\QuoteStrategy; | ||
| 11 | use Doctrine\ORM\UnitOfWork; | ||
| 12 | |||
| 13 | /** | ||
| 14 | * Base class for all collection persisters. | ||
| 15 | */ | ||
| 16 | abstract class AbstractCollectionPersister implements CollectionPersister | ||
| 17 | { | ||
| 18 | protected Connection $conn; | ||
| 19 | protected UnitOfWork $uow; | ||
| 20 | protected AbstractPlatform $platform; | ||
| 21 | protected QuoteStrategy $quoteStrategy; | ||
| 22 | |||
| 23 | /** | ||
| 24 | * Initializes a new instance of a class derived from AbstractCollectionPersister. | ||
| 25 | */ | ||
| 26 | public function __construct( | ||
| 27 | protected EntityManagerInterface $em, | ||
| 28 | ) { | ||
| 29 | $this->uow = $em->getUnitOfWork(); | ||
| 30 | $this->conn = $em->getConnection(); | ||
| 31 | $this->platform = $this->conn->getDatabasePlatform(); | ||
| 32 | $this->quoteStrategy = $em->getConfiguration()->getQuoteStrategy(); | ||
| 33 | } | ||
| 34 | |||
| 35 | /** | ||
| 36 | * Check if entity is in a valid state for operations. | ||
| 37 | */ | ||
| 38 | protected function isValidEntityState(object $entity): bool | ||
| 39 | { | ||
| 40 | $entityState = $this->uow->getEntityState($entity, UnitOfWork::STATE_NEW); | ||
| 41 | |||
| 42 | if ($entityState === UnitOfWork::STATE_NEW) { | ||
| 43 | return false; | ||
| 44 | } | ||
| 45 | |||
| 46 | // If Entity is scheduled for inclusion, it is not in this collection. | ||
| 47 | // We can assure that because it would have return true before on array check | ||
| 48 | return ! ($entityState === UnitOfWork::STATE_MANAGED && $this->uow->isScheduledForInsert($entity)); | ||
| 49 | } | ||
| 50 | } | ||
