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

SnapshotMeta   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getEntity() 0 4 1
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