Completed
Pull Request — master (#4)
by Tim
02:29
created

OptionSubject   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 42
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getLastEntityId() 0 4 1
A setLastOptionId() 0 4 1
A getLastOptionId() 0 4 1
1
<?php
2
3
/**
4
 * TechDivision\Import\Attribute\Subjects\OptionSubject
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2016 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/techdivision/import-attribute
18
 * @link      http://www.techdivision.com
19
 */
20
21
namespace TechDivision\Import\Attribute\Subjects;
22
23
/**
24
 * The subject implementation that handles the business logic to persist attribute options.
25
 *
26
 * @author    Tim Wagner <[email protected]>
27
 * @copyright 2016 TechDivision GmbH <[email protected]>
28
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
 * @link      https://github.com/techdivision/import-attribute
30
 * @link      http://www.techdivision.com
31
 */
32
class OptionSubject extends AbstractAttributeSubject
33
{
34
35
    /**
36
     * The ID of the option that has been created recently.
37
     *
38
     * @var integer
39
     */
40
    protected $lastOptionId;
41
42
    /**
43
     * Return's the ID of the attribute that has been created recently.
44
     *
45
     * @return integer The attribute ID
46
     */
47
    public function getLastEntityId()
48
    {
49
        return $this->getLastOptionId();
50
    }
51
52
    /**
53
     * Set's the ID of the option that has been created recently.
54
     *
55
     * @param integer $lastOptionId The option ID
56
     *
57
     * @return void
58
     */
59
    public function setLastOptionId($lastOptionId)
60
    {
61
        $this->lastOptionId = $lastOptionId;
62
    }
63
64
    /**
65
     * Return's the ID of the option that has been created recently.
66
     *
67
     * @return integer The option ID
68
     */
69
    public function getLastOptionId()
70
    {
71
        return $this->lastOptionId;
72
    }
73
}
74