1 | <?php |
||
36 | class LinkObserver extends AbstractProductImportObserver |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * Process the observer's business logic. |
||
41 | * |
||
42 | * @return array The processed row |
||
43 | */ |
||
44 | protected function process() |
||
56 | |||
57 | /** |
||
58 | * Prepare the attributes of the entity that has to be persisted. |
||
59 | * |
||
60 | * @return array The prepared attributes |
||
61 | */ |
||
62 | protected function prepareAttributes() |
||
97 | |||
98 | /** |
||
99 | * Initialize the product link with the passed attributes and returns an instance. |
||
100 | * |
||
101 | * @param array $attr The product link attributes |
||
102 | * |
||
103 | * @return array The initialized product link |
||
104 | */ |
||
105 | protected function initializeProductLink(array $attr) |
||
109 | |||
110 | /** |
||
111 | * Temporary persist the last link ID. |
||
112 | * |
||
113 | * @param integer $lastLinkId The last link ID |
||
114 | * |
||
115 | * @return void |
||
116 | */ |
||
117 | protected function setLastLinkId($lastLinkId) |
||
121 | |||
122 | /** |
||
123 | * Persist's the passed product link data and return's the ID. |
||
124 | * |
||
125 | * @param array $productLink The product link data to persist |
||
126 | * |
||
127 | * @return string The ID of the persisted entity |
||
128 | */ |
||
129 | protected function persistProductLink($productLink) |
||
133 | |||
134 | /** |
||
135 | * Return the entity ID for the passed SKU. |
||
136 | * |
||
137 | * @param string $sku The SKU to return the entity ID for |
||
138 | * |
||
139 | * @return integer The mapped entity ID |
||
140 | * @throws \TechDivision\Import\Product\Link\Exceptions\MapSkuToEntityIdException Is thrown if the SKU is not mapped yet |
||
141 | */ |
||
142 | protected function mapSkuToEntityId($sku) |
||
146 | |||
147 | /** |
||
148 | * Return the entity ID for the passed SKU. |
||
149 | * |
||
150 | * @param string $sku The SKU to return the entity ID for |
||
151 | * |
||
152 | * @return integer The mapped entity ID |
||
153 | * @throws \TechDivision\Import\Product\Link\Exceptions\MapSkuToEntityIdException Is thrown if the SKU is not mapped yet |
||
154 | */ |
||
155 | protected function mapSku($sku) |
||
159 | |||
160 | /** |
||
161 | * Return the link type ID for the passed link type code. |
||
162 | * |
||
163 | * @param string $linkTypeCode The link type code to return the link type ID for |
||
164 | * |
||
165 | * @return integer The mapped link type ID |
||
166 | * @throws \TechDivision\Import\Product\Link\Exceptions\MapLinkTypeCodeToIdException Is thrown if the link type code is not mapped yet |
||
167 | */ |
||
168 | protected function mapLinkTypeCodeToLinkTypeId($linkTypeCode) |
||
172 | |||
173 | /** |
||
174 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
175 | * |
||
176 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
177 | */ |
||
178 | protected function isDebugMode() |
||
182 | } |
||
183 |