TaxonBlock::setTaxon()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Lakion\CmsPlugin\Document;
4
5
use Sylius\Component\Core\Model\TaxonInterface;
6
7
class TaxonBlock extends CustomBlock
8
{
9
    /**
10
     * @var TaxonInterface
11
     */
12
    protected $taxon;
13
14
    /**
15
     * @var string
16
     */
17
    protected $taxonCode;
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function getType()
23
    {
24
        return 'lakion_cms.block.taxon';
25
    }
26
27
    /**
28
     * @return TaxonInterface
29
     */
30
    public function getTaxon()
31
    {
32
        return $this->taxon;
33
    }
34
35
    /**
36
     * @param TaxonInterface $taxon
37
     */
38
    public function setTaxon(TaxonInterface $taxon)
39
    {
40
        $this->taxon = $taxon;
41
        $this->taxonCode = $taxon->getCode();
42
    }
43
44
    /**
45
     * @return string
46
     */
47
    public function getTaxonCode()
48
    {
49
        return $this->taxonCode;
50
    }
51
52
    /**
53
     * @param string $taxonCode
54
     */
55
    public function setTaxonCode($taxonCode)
56
    {
57
        $this->taxonCode = $taxonCode;
58
    }
59
}
60