These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Doctrine\ODM\MongoDB\Event; |
||
6 | |||
7 | use Doctrine\ODM\MongoDB\DocumentManager; |
||
8 | use Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface; |
||
9 | use const E_USER_DEPRECATED; |
||
10 | use function sprintf; |
||
11 | use function trigger_error; |
||
12 | |||
13 | /** |
||
14 | * Class that holds arguments for postCollectionLoad event. |
||
15 | * |
||
16 | * @final |
||
17 | */ |
||
18 | View Code Duplication | class PostCollectionLoadEventArgs extends ManagerEventArgs |
|
19 | { |
||
20 | /** @var PersistentCollectionInterface */ |
||
21 | private $collection; |
||
22 | |||
23 | 178 | public function __construct(PersistentCollectionInterface $collection, DocumentManager $dm) |
|
24 | { |
||
25 | 178 | if (self::class !== static::class) { |
|
26 | @trigger_error(sprintf('The class "%s" extends "%s" which will be final in MongoDB ODM 2.0.', static::class, self::class), E_USER_DEPRECATED); |
||
0 ignored issues
–
show
|
|||
27 | } |
||
28 | 178 | parent::__construct($dm); |
|
29 | 178 | $this->collection = $collection; |
|
30 | 178 | } |
|
31 | |||
32 | /** |
||
33 | * Gets collection that was just initialized (loaded). |
||
34 | */ |
||
35 | 1 | public function getCollection() : PersistentCollectionInterface |
|
36 | { |
||
37 | 1 | return $this->collection; |
|
38 | } |
||
39 | } |
||
40 |
If you suppress an error, we recommend checking for the error condition explicitly: