|
@@ 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(); |
|
@@ 298-304 (lines=7) @@
|
| 295 |
|
$this->persistUrlRewriteProductCategory($urlRewriteProductCategory); |
| 296 |
|
} catch (\Exception $e) { |
| 297 |
|
// query whether or not debug mode has been enabled |
| 298 |
|
if ($this->getSubject()->isDebugMode()) { |
| 299 |
|
$this->getSubject() |
| 300 |
|
->getSystemLogger() |
| 301 |
|
->warning($this->getSubject()->appendExceptionSuffix($e->getMessage())); |
| 302 |
|
} else { |
| 303 |
|
throw $e; |
| 304 |
|
} |
| 305 |
|
} |
| 306 |
|
} |
| 307 |
|
} |
|
@@ 364-370 (lines=7) @@
|
| 361 |
|
$this->resolveCategoryIds($category[MemberNames::ENTITY_ID], true, $storeViewCode); |
| 362 |
|
} catch (\Exception $e) { |
| 363 |
|
// query whether or not debug mode has been enabled |
| 364 |
|
if ($this->getSubject()->isDebugMode()) { |
| 365 |
|
$this->getSubject() |
| 366 |
|
->getSystemLogger() |
| 367 |
|
->warning($this->getSubject()->appendExceptionSuffix($e->getMessage())); |
| 368 |
|
} else { |
| 369 |
|
throw $e; |
| 370 |
|
} |
| 371 |
|
} |
| 372 |
|
} |
| 373 |
|
|