Completed
Pull Request — master (#1379)
by Maciej
16:13
created

PostCollectionLoadEventArgs::getCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Doctrine\ODM\MongoDB\Event;
4
5
use Doctrine\ODM\MongoDB\DocumentManager;
6
use Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionInterface;
7
8
/**
9
 * Class that holds arguments for postCollectionLoad event.
10
 * 
11
 * @since 1.1
12
 */
13
class PostCollectionLoadEventArgs extends ManagerEventArgs
14
{
15
    /**
16
     * @var PersistentCollectionInterface
17
     */
18
    private $collection;
19
20
    /**
21
     * @param PersistentCollectionInterface $collection
22
     * @param DocumentManager $dm
23
     */
24 161
    public function __construct(PersistentCollectionInterface $collection, DocumentManager $dm)
25
    {
26 161
        parent::__construct($dm);
27 161
        $this->collection = $collection;
28 161
    }
29
30
    /**
31
     * Gets collection that was just initialized (loaded).
32
     *
33
     * @return PersistentCollectionInterface
34
     */
35 1
    public function getCollection()
36
    {
37 1
        return $this->collection;
38
    }
39
}
40