Completed
Pull Request — master (#1336)
by Andreas
11:45
created

DocumentNotFoundEventArgs::getProxy()   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
 *  $Id$
4
 *
5
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
 *
17
 * This software consists of voluntary contributions made by many individuals
18
 * and is licensed under the MIT license. For more information, see
19
 * <http://www.doctrine-project.org>.
20
 */
21
22
namespace Doctrine\ODM\MongoDB\Event;
23
24
use Doctrine\Common\EventArgs;
25
26
/**
27
 * Provides event arguments for the documentNotFound event.
28
 *
29
 * @since 1.1
30
 */
31
class DocumentNotFoundEventArgs extends EventArgs
32
{
33
    /**
34
     * @var object
35
     */
36
    private $proxy;
37
38
    /**
39
     * @var string
40
     */
41
    private $identifier;
42
43
    /**
44
     * @var bool
45
     */
46
    private $disableException = false;
47
48
    /**
49
     * Constructor.
50
     *
51
     * @param object $proxy
52
     * @param string $identifier
53
     */
54 9
    public function __construct($proxy, $identifier)
55
    {
56 9
        $this->proxy = $proxy;
57 9
        $this->identifier = $identifier;
58 9
    }
59
60
    /**
61
     * Retrieve associated proxy.
62
     *
63
     * @return object
64
     */
65 1
    public function getProxy()
66
    {
67 1
        return $this->proxy;
68
    }
69
70
    /**
71
     * Retrieve associated identifier.
72
     *
73
     * @return string
74
     */
75
    public function getIdentifier()
76
    {
77
        return $this->identifier;
78
    }
79
80
    /**
81
     * Indicates whether the proxy initialization exception is disabled.
82
     *
83
     * @return bool
84
     */
85 9
    public function isExceptionDisabled()
86
    {
87 9
        return $this->disableException;
88
    }
89
90
    /**
91
     * Disable the throwing of an exception
92
     *
93
     * This method indicates to the proxy initializer that the missing document
94
     * has been handled and no exception should be thrown. This can't be reset.
95
     */
96 1
    public function disableException()
97
    {
98 1
        $this->disableException = true;
99 1
    }
100
}
101