Completed
Branch master (3b8125)
by
unknown
01:32
created

InitPropertyManager::setProperty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace HelloWordPl\SimpleEntityGeneratorBundle\Lib\Items;
4
5
use HelloWordPl\SimpleEntityGeneratorBundle\Lib\Interfaces\RenderableInterface;
6
use Symfony\Component\Validator\Constraints as Assert;
7
use HelloWordPl\SimpleEntityGeneratorBundle\Lib\Traits\TemplateTrait;
8
9
/**
10
 * Manager for init ArrayCollection properties in constructor
11
 *
12
 * @author Sławomir Kania <[email protected]>
13
 */
14
class InitPropertyManager implements RenderableInterface
15
{
16
    use TemplateTrait;
17
18
    /**
19
     * Property
20
     *
21
     * @Assert\NotNull(message="Init property has to know about property")
22
     * @Assert\Valid()
23
     * @var PropertyManager
24
     */
25
    private $property = null;
26
27
    /**
28
     * @return PropertyManager
29
     */
30
    public function getProperty()
31
    {
32
        return $this->property;
33
    }
34
35
    /**
36
     * @param PropertyManager $property
37
     * @return ClassManager
38
     */
39
    public function setProperty(PropertyManager $property)
40
    {
41
        $this->property = $property;
42
        return $this;
43
    }
44
45
    /**
46
     * Return set of tags used in template
47
     *
48
     * @return array
49
     */
50
    public function getTemplateTags()
51
    {
52
        return [
53
            self::TAG_PROPERTY_NAME,
54
            self::TAG_PROPERTY_TYPE,
55
        ];
56
    }
57
}
58