Completed
Push — develop ( 62651e...ddc457 )
by
unknown
09:17
created

SnapshotMeta::getEntity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 * @author    [email protected]
9
 */
10
11
namespace Core\Entity;
12
13
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
14
use Core\Exception\ImmutablePropertyException;
15
16
/**
17
 * Class SnapshotMeta
18
 *
19
 * @ODM\EmbeddedDocument
20
 * @ODM\HasLifecycleCallbacks
21
 */
22
class SnapshotMeta implements ModificationDateAwareEntityInterface, DraftableEntityInterface
23
{
24
    use ModificationDateAwareEntityTrait, DraftableEntityTrait;
25
26
    /**
27
     * @var EntityInterface
28
     * @ODM\ReferenceOne(discriminatorField="_entity", storeAs="dbRef")
29
     */
30
    protected $entity;
31
32
    /**
33
     * Sets the entity
34
     *
35
     * @param $entity
36
     * @throws \Core\Exception\ImmutablePropertyException
37
     */
38
    public function __construct($entity)
39
    {
40
        $this->entity = $entity;
41
        return $this;
0 ignored issues
show
Bug introduced by
Constructors do not have meaningful return values, anything that is returned from here is discarded. Are you sure this is correct?
Loading history...
42
    }
43
44
    /**
45
     * Gets the Entity
46
     *
47
     * @return EntityInterface
48
     */
49
    public function getEntity()
50
    {
51
        return $this->entity;
52
    }
53
54
}
55