Completed
Pull Request — master (#1376)
by Bilge
30:49 queued 28:17
created

PreLoadEventArgs   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 30
ccs 0
cts 9
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getData() 0 4 1
1
<?php
2
/*
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the MIT license. For more information, see
17
 * <http://www.doctrine-project.org>.
18
 */
19
20
namespace Doctrine\ODM\MongoDB\Event;
21
22
use Doctrine\ODM\MongoDB\DocumentManager;
23
24
/**
25
 * Class that holds event arguments for a preLoad event.
26
 *
27
 * @since 1.0
28
 */
29
class PreLoadEventArgs extends LifecycleEventArgs
30
{
31
    /**
32
     * @var array
33
     */
34
    private $data;
35
36
    /**
37
     * Constructor.
38
     *
39
     * @param object          $document
40
     * @param DocumentManager $dm
41
     * @param array           $data     Array of data to be loaded and hydrated
42
     */
43
    public function __construct($document, DocumentManager $dm, array &$data)
44
    {
45
        parent::__construct($document, $dm);
46
        $this->data =& $data;
47
    }
48
49
    /**
50
     * Get the array of data to be loaded and hydrated.
51
     *
52
     * @return array
53
     */
54
    public function &getData()
55
    {
56
        return $this->data;
57
    }
58
}
59