diff options
| author | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2024-08-13 23:45:21 +0200 |
| commit | bf6655a534a6775d30cafa67bd801276bda1d98d (patch) | |
| tree | c6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/doctrine/orm/src/Event/OnClassMetadataNotFoundEventArgs.php | |
| parent | 94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff) | |
| download | AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.gz AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.tar.bz2 AppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip | |
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/doctrine/orm/src/Event/OnClassMetadataNotFoundEventArgs.php')
| -rw-r--r-- | vendor/doctrine/orm/src/Event/OnClassMetadataNotFoundEventArgs.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Event/OnClassMetadataNotFoundEventArgs.php b/vendor/doctrine/orm/src/Event/OnClassMetadataNotFoundEventArgs.php new file mode 100644 index 0000000..762c083 --- /dev/null +++ b/vendor/doctrine/orm/src/Event/OnClassMetadataNotFoundEventArgs.php | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | declare(strict_types=1); | ||
| 4 | |||
| 5 | namespace Doctrine\ORM\Event; | ||
| 6 | |||
| 7 | use Doctrine\ORM\EntityManagerInterface; | ||
| 8 | use Doctrine\Persistence\Event\ManagerEventArgs; | ||
| 9 | use Doctrine\Persistence\Mapping\ClassMetadata; | ||
| 10 | use Doctrine\Persistence\ObjectManager; | ||
| 11 | |||
| 12 | /** | ||
| 13 | * Class that holds event arguments for a `onClassMetadataNotFound` event. | ||
| 14 | * | ||
| 15 | * This object is mutable by design, allowing callbacks having access to it to set the | ||
| 16 | * found metadata in it, and therefore "cancelling" a `onClassMetadataNotFound` event | ||
| 17 | * | ||
| 18 | * @extends ManagerEventArgs<EntityManagerInterface> | ||
| 19 | */ | ||
| 20 | class OnClassMetadataNotFoundEventArgs extends ManagerEventArgs | ||
| 21 | { | ||
| 22 | private ClassMetadata|null $foundMetadata = null; | ||
| 23 | |||
| 24 | /** @param EntityManagerInterface $objectManager */ | ||
| 25 | public function __construct( | ||
| 26 | private readonly string $className, | ||
| 27 | ObjectManager $objectManager, | ||
| 28 | ) { | ||
| 29 | parent::__construct($objectManager); | ||
| 30 | } | ||
| 31 | |||
| 32 | public function setFoundMetadata(ClassMetadata|null $classMetadata): void | ||
| 33 | { | ||
| 34 | $this->foundMetadata = $classMetadata; | ||
| 35 | } | ||
| 36 | |||
| 37 | public function getFoundMetadata(): ClassMetadata|null | ||
| 38 | { | ||
| 39 | return $this->foundMetadata; | ||
| 40 | } | ||
| 41 | |||
| 42 | /** | ||
| 43 | * Retrieve class name for which a failed metadata fetch attempt was executed | ||
| 44 | */ | ||
| 45 | public function getClassName(): string | ||
| 46 | { | ||
| 47 | return $this->className; | ||
| 48 | } | ||
| 49 | } | ||
