|
@@ 146-156 (lines=11) @@
|
| 143 |
|
// try to load the entity ID for the product with the passed SKU |
| 144 |
|
if ($product = $this->loadProduct($sku = $this->getValue(ColumnKeys::SKU))) { |
| 145 |
|
$this->setLastEntityId($this->entityId = $product[MemberNames::ENTITY_ID]); |
| 146 |
|
} else { |
| 147 |
|
// prepare a log message |
| 148 |
|
$message = sprintf('Product with SKU "%s" can\'t be loaded to create URL rewrites', $sku); |
| 149 |
|
// query whether or not we're in debug mode |
| 150 |
|
if ($this->getSubject()->isDebugMode()) { |
| 151 |
|
$this->getSubject()->getSystemLogger()->warning($message); |
| 152 |
|
return $this->getRow(); |
| 153 |
|
} else { |
| 154 |
|
throw new \Exception($this->appendExceptionSuffix($message)); |
| 155 |
|
} |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
// try to load the URL key |
| 159 |
|
if ($this->hasValue(ColumnKeys::URL_KEY)) { |
|
@@ 161-171 (lines=11) @@
|
| 158 |
|
// try to load the URL key |
| 159 |
|
if ($this->hasValue(ColumnKeys::URL_KEY)) { |
| 160 |
|
$this->urlKey = $this->getValue(ColumnKeys::URL_KEY); |
| 161 |
|
} else { |
| 162 |
|
// prepare a log message |
| 163 |
|
$message = sprintf('Can\'t find a value in column "url_key" for product with SKU "%s"', $sku); |
| 164 |
|
// query whether or not we're in debug mode |
| 165 |
|
if ($this->getSubject()->isDebugMode()) { |
| 166 |
|
$this->getSubject()->getSystemLogger()->warning($message); |
| 167 |
|
return $this->getRow(); |
| 168 |
|
} else { |
| 169 |
|
throw new \Exception($this->appendExceptionSuffix($message)); |
| 170 |
|
} |
| 171 |
|
} |
| 172 |
|
|
| 173 |
|
// initialize the store view code |
| 174 |
|
$this->getSubject()->prepareStoreViewCode(); |
|
@@ 281-287 (lines=7) @@
|
| 278 |
|
$this->persistUrlRewriteProductCategory($urlRewriteProductCategory); |
| 279 |
|
} catch (\Exception $e) { |
| 280 |
|
// query whether or not debug mode has been enabled |
| 281 |
|
if ($this->getSubject()->isDebugMode()) { |
| 282 |
|
$this->getSubject() |
| 283 |
|
->getSystemLogger() |
| 284 |
|
->warning($this->getSubject()->appendExceptionSuffix($e->getMessage())); |
| 285 |
|
} else { |
| 286 |
|
throw $e; |
| 287 |
|
} |
| 288 |
|
} |
| 289 |
|
} |
| 290 |
|
} |
|
@@ 367-373 (lines=7) @@
|
| 364 |
|
$this->resolveCategoryIds($category[MemberNames::ENTITY_ID], true, $storeViewCode); |
| 365 |
|
} catch (\Exception $e) { |
| 366 |
|
// query whether or not debug mode has been enabled |
| 367 |
|
if ($this->getSubject()->isDebugMode()) { |
| 368 |
|
$this->getSubject() |
| 369 |
|
->getSystemLogger() |
| 370 |
|
->warning($this->getSubject()->appendExceptionSuffix($e->getMessage())); |
| 371 |
|
} else { |
| 372 |
|
throw $e; |
| 373 |
|
} |
| 374 |
|
} |
| 375 |
|
} |
| 376 |
|
|