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() |
||
53 | |||
54 | /** |
||
55 | * Prepare the attributes of the entity that has to be persisted. |
||
56 | * |
||
57 | * @return array The prepared attributes |
||
58 | */ |
||
59 | protected function prepareAttributes() |
||
81 | |||
82 | /** |
||
83 | * Initialize the product link with the passed attributes and returns an instance. |
||
84 | * |
||
85 | * @param array $attr The product link attributes |
||
86 | * |
||
87 | * @return array The initialized product link |
||
88 | */ |
||
89 | protected function initializeProductLink(array $attr) |
||
93 | |||
94 | /** |
||
95 | * Temporary persist the last link ID. |
||
96 | * |
||
97 | * @param integer $lastLinkId The last link ID |
||
98 | * |
||
99 | * @return void |
||
100 | */ |
||
101 | protected function setLastLinkId($lastLinkId) |
||
105 | |||
106 | /** |
||
107 | * Persist's the passed product link data and return's the ID. |
||
108 | * |
||
109 | * @param array $productLink The product link data to persist |
||
110 | * |
||
111 | * @return string The ID of the persisted entity |
||
112 | */ |
||
113 | protected function persistProductLink($productLink) |
||
117 | |||
118 | /** |
||
119 | * Return the entity ID for the passed SKU. |
||
120 | * |
||
121 | * @param string $sku The SKU to return the entity ID for |
||
122 | * |
||
123 | * @return integer The mapped entity ID |
||
124 | * @throws \Exception Is thrown if the SKU is not mapped yet |
||
125 | */ |
||
126 | protected function mapSkuToEntityId($sku) |
||
130 | |||
131 | /** |
||
132 | * Return the entity ID for the passed SKU. |
||
133 | * |
||
134 | * @param string $sku The SKU to return the entity ID for |
||
135 | * |
||
136 | * @return integer The mapped entity ID |
||
137 | * @throws \Exception Is thrown if the SKU is not mapped yet |
||
138 | */ |
||
139 | protected function mapSku($sku) |
||
143 | |||
144 | /** |
||
145 | * Return the link type ID for the passed link type code. |
||
146 | * |
||
147 | * @param string $linkTypeCode The link type code to return the link type ID for |
||
148 | * |
||
149 | * @return integer The mapped link type ID |
||
150 | * @throws \Exception Is thrown if the link type code is not mapped yet |
||
151 | */ |
||
152 | protected function mapLinkTypeCodeToLinkTypeId($linkTypeCode) |
||
156 | } |
||
157 |