Completed
Pull Request — master (#1984)
by Maciej
22:01
created

PostCollectionLoadEventArgs::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
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
10
/**
11
 * Class that holds arguments for postCollectionLoad event.
12
 */
13
final class PostCollectionLoadEventArgs extends ManagerEventArgs
14
{
15
    /** @var PersistentCollectionInterface */
16
    private $collection;
17
18 178
    public function __construct(PersistentCollectionInterface $collection, DocumentManager $dm)
19
    {
20 178
        parent::__construct($dm);
21 178
        $this->collection = $collection;
22 178
    }
23
24
    /**
25
     * Gets collection that was just initialized (loaded).
26
     */
27 1
    public function getCollection() : PersistentCollectionInterface
28
    {
29 1
        return $this->collection;
30
    }
31
}
32