Data::getEntity()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @link    https://github.com/nnx-framework/jms-serializer-module
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace Nnx\JmsSerializerModule\ObjectConstructor\DoctrineObjectConstructor;
7
8
use Nnx\JmsSerializerModule\DataContainer\DataContainerInterface;
9
use Nnx\JmsSerializerModule\DataContainer\EntityInterface;
10
11
/**
12
 * Class Data
13
 *
14
 * @package Nnx\JmsSerializerModule\ObjectConstructor\DoctrineObjectConstructor
15
 */
16
class Data implements DataInterface
17
{
18
    /**
19
     * Контейнер с данными
20
     *
21
     * @var DataContainerInterface
22
     */
23
    protected $dataContainer;
24
25
    /**
26
     * Сущность для которой происходит запрос
27
     *
28
     * @var EntityInterface
29
     */
30
    protected $entity;
31
32
    /**
33
     * Data constructor.
34
     *
35
     * @param DataContainerInterface $dataContainer
36
     * @param EntityInterface        $entity
37
     */
38
    public function __construct(DataContainerInterface $dataContainer, EntityInterface $entity)
39
    {
40
        $this->dataContainer = $dataContainer;
41
        $this->entity = $entity;
42
    }
43
44
    /**
45
     * Возвращает контейнер с данными
46
     *
47
     * @return DataContainerInterface
48
     */
49
    public function getDataContainer()
50
    {
51
        return $this->dataContainer;
52
    }
53
54
    /**
55
     * Возвращает сущность для которой происходит запрос
56
     *
57
     * @return EntityInterface
58
     */
59
    public function getEntity()
60
    {
61
        return $this->entity;
62
    }
63
}
64