1 | <?php |
||
39 | class OptionSubject extends AbstractAttributeSubject |
||
40 | { |
||
41 | |||
42 | /** |
||
43 | * The attribute processor instance. |
||
44 | * |
||
45 | * @var \TechDivision\Import\Attribute\Services\AttributeBunchProcessorInterface |
||
46 | */ |
||
47 | protected $attributeBunchProcessor; |
||
48 | |||
49 | /** |
||
50 | * The ID of the option that has been created recently. |
||
51 | * |
||
52 | * @var integer |
||
53 | */ |
||
54 | protected $lastOptionId; |
||
55 | |||
56 | /** |
||
57 | * The value => option ID mapping. |
||
58 | * |
||
59 | * @var array |
||
60 | */ |
||
61 | protected $attributeCodeValueOptionIdMapping = array(); |
||
62 | |||
63 | /** |
||
64 | * Initialize the subject instance. |
||
65 | * |
||
66 | * @param \TechDivision\Import\Configuration\SubjectConfigurationInterface $configuration The subject configuration instance |
||
67 | * @param \TechDivision\Import\Services\RegistryProcessorInterface $registryProcessor The registry processor instance |
||
68 | * @param \TechDivision\Import\Utils\Generators\GeneratorInterface $coreConfigDataUidGenerator The UID generator for the core config data |
||
69 | * @param array $systemLoggers The array with the system loggers instances |
||
70 | * @param \TechDivision\Import\Attribute\Services\AttributeBunchProcessorInterface $attributeBunchProcessor The attribute bunch processor instance |
||
71 | */ |
||
72 | public function __construct( |
||
86 | |||
87 | /** |
||
88 | * Return's the attribute bunch processor instance. |
||
89 | * |
||
90 | * @return \TechDivision\Import\Attribute\Services\AttributeBunchProcessorInterface The attribute bunch processor instance |
||
91 | */ |
||
92 | protected function getAttributeBunchProcessor() |
||
96 | |||
97 | /** |
||
98 | * Map's the passed attribue code and value to the option ID that has been created recently. |
||
99 | * |
||
100 | * @param string $attributeCode The attriburte code that has to be mapped |
||
101 | * @param string $value The value that has to be mapped |
||
102 | * |
||
103 | * @return void |
||
104 | */ |
||
105 | public function addAddtributeCodeValueOptionIdMapping($attributeCode, $value) |
||
109 | |||
110 | /** |
||
111 | * Queries whether or not the attribute with the passed code/value has already been processed. |
||
112 | * |
||
113 | * @param string $attributeCode The attribute code to check |
||
114 | * @param string $value The option value to check |
||
115 | * |
||
116 | * @return boolean TRUE if the path has been processed, else FALSE |
||
117 | */ |
||
118 | public function hasBeenProcessed($attributeCode, $value) |
||
122 | |||
123 | /** |
||
124 | * Return's the ID of the attribute that has been created recently. |
||
125 | * |
||
126 | * @return integer The attribute ID |
||
127 | */ |
||
128 | public function getLastEntityId() |
||
132 | |||
133 | /** |
||
134 | * Set's the ID of the option that has been created recently. |
||
135 | * |
||
136 | * @param integer $lastOptionId The option ID |
||
137 | * |
||
138 | * @return void |
||
139 | */ |
||
140 | public function setLastOptionId($lastOptionId) |
||
144 | |||
145 | /** |
||
146 | * Return's the ID of the option that has been created recently. |
||
147 | * |
||
148 | * @return integer The option ID |
||
149 | */ |
||
150 | public function getLastOptionId() |
||
154 | |||
155 | /** |
||
156 | * Pre-load the option ID for the EAV attribute option with the passed attribute code/value. |
||
157 | * |
||
158 | * @param string $attributeCode The code of the EAV attribute to pre-load |
||
159 | * @param string $value The option admin store view value of the EAV attribute option to pre-load |
||
160 | * |
||
161 | * @return void |
||
162 | */ |
||
163 | public function preLoadOptionId($attributeCode, $value) |
||
175 | } |
||
176 |