1 | <?php |
||
36 | abstract class AbstractAttributeImportObserver extends AbstractObserver implements AttributeImportObserverInterface |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * Will be invoked by the action on the events the listener has been registered for. |
||
41 | * |
||
42 | * @param \TechDivision\Import\Subjects\SubjectInterface $subject The subject instance |
||
43 | * |
||
44 | * @return array The modified row |
||
45 | * @see \TechDivision\Import\Product\Observers\ImportObserverInterface::handle() |
||
46 | */ |
||
47 | public function handle(SubjectInterface $subject) |
||
60 | |||
61 | /** |
||
62 | * Return's whether or not this is the admin store view. |
||
63 | * |
||
64 | * @return boolean TRUE if we're in admin store view, else FALSE |
||
65 | */ |
||
66 | protected function isAdminStore() |
||
70 | |||
71 | /** |
||
72 | * Process the observer's business logic. |
||
73 | * |
||
74 | * @return void |
||
75 | */ |
||
76 | abstract protected function process(); |
||
77 | |||
78 | |||
79 | /** |
||
80 | * Prepare data array by given values in source |
||
81 | * |
||
82 | * @param array $keys |
||
83 | * @param bool $useDefaults |
||
84 | * @return array |
||
85 | */ |
||
86 | protected function getPreparedAttributeData(array $keys, $useDefaults = true) |
||
96 | |||
97 | /** |
||
98 | * @return array |
||
99 | */ |
||
100 | protected function getDefaultValues() |
||
104 | |||
105 | /** |
||
106 | * Retrieve default value for given key |
||
107 | * |
||
108 | * @param string $key |
||
109 | * @return null |
||
110 | */ |
||
111 | protected function getDefaultValue($key) |
||
121 | |||
122 | /** |
||
123 | * @return array |
||
124 | */ |
||
125 | protected function getCallbacks() |
||
129 | |||
130 | /** |
||
131 | * Retrieve callbacks for given column key |
||
132 | * |
||
133 | * @param string $key |
||
134 | * @return null |
||
135 | */ |
||
136 | protected function getCallback($key) |
||
146 | } |
||
147 |