1 | <?php |
||
36 | abstract class AbstractEavAwareCallback extends AbstractCallback |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The EAV aware processor. |
||
41 | * |
||
42 | * @var \TechDivision\Import\Services\EavAwareProcessorInterface |
||
43 | */ |
||
44 | protected $eavAwareProcessor; |
||
45 | |||
46 | /** |
||
47 | * The configuration instance. |
||
48 | * |
||
49 | * @var \TechDivision\Import\ConfigurationInterface |
||
50 | */ |
||
51 | protected $configuration; |
||
52 | |||
53 | /** |
||
54 | * Initialize the callback with the passed processor instance. |
||
55 | * |
||
56 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
57 | * @param \TechDivision\Import\Services\EavAwareProcessorInterface $eavAwareProcessor The processor instance |
||
58 | */ |
||
59 | public function __construct(ConfigurationInterface $configuration, EavAwareProcessorInterface $eavAwareProcessor) |
||
64 | |||
65 | /** |
||
66 | * Return's the EAV aware processor instance. |
||
67 | * |
||
68 | * @return \TechDivision\Import\Services\EavAwareProcessorInterface The processor instance |
||
69 | */ |
||
70 | protected function getEavAwareProcessor() |
||
74 | |||
75 | /** |
||
76 | * Returns the configuration instance. |
||
77 | * |
||
78 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
79 | */ |
||
80 | protected function getConfiguration() |
||
84 | |||
85 | /** |
||
86 | * Returns the configured entity type code. |
||
87 | * |
||
88 | * @return string The entity type code from the configuration |
||
89 | */ |
||
90 | protected function getEntityTypeCode() |
||
94 | |||
95 | /** |
||
96 | * Returns the entity type ID for the configured entity type code. |
||
97 | * |
||
98 | * @return integer The entity type ID of the configured entity type |
||
99 | */ |
||
100 | protected function getEntityTypeId() |
||
109 | |||
110 | /** |
||
111 | * Load's and return's the EAV attribute option value with the passed entity type ID, code, store ID and value. |
||
112 | * |
||
113 | * @param string $entityTypeId The entity type ID of the EAV attribute to load the option value for |
||
114 | * @param string $attributeCode The code of the EAV attribute option to load |
||
115 | * @param integer $storeId The store ID of the attribute option to load |
||
116 | * @param string $value The value of the attribute option to load |
||
117 | * |
||
118 | * @return array The EAV attribute option value |
||
119 | */ |
||
120 | protected function loadAttributeOptionValueByEntityTypeIdAndAttributeCodeAndStoreIdAndValue($entityTypeId, $attributeCode, $storeId, $value) |
||
124 | } |
||
125 |