| @@ 265-279 (lines=15) @@ | ||
| 262 | * @return integer The mapped entity ID |
|
| 263 | * @throws \Exception Is thrown, if the path can not be mapped |
|
| 264 | */ |
|
| 265 | public function mapPathEntityId($path) |
|
| 266 | { |
|
| 267 | ||
| 268 | // query whether or not a entity ID for the passed path has been mapped |
|
| 269 | if (isset($this->pathEntityIdMapping[$unifiedPath = $this->unifyPath($path)])) { |
|
| 270 | return $this->pathEntityIdMapping[$unifiedPath]; |
|
| 271 | } |
|
| 272 | ||
| 273 | // throw an exception if not |
|
| 274 | throw new \Exception( |
|
| 275 | $this->appendExceptionSuffix( |
|
| 276 | sprintf('Can\'t map path %s to any entity ID', $path) |
|
| 277 | ) |
|
| 278 | ); |
|
| 279 | } |
|
| 280 | ||
| 281 | /** |
|
| 282 | * Add the passed path => store view code mapping. |
|
| @@ 411-425 (lines=15) @@ | ||
| 408 | * @return integer The store website ID |
|
| 409 | * @throws \Exception Is thrown, if the store website with the requested code is not available |
|
| 410 | */ |
|
| 411 | public function getStoreWebsiteIdByCode($code) |
|
| 412 | { |
|
| 413 | ||
| 414 | // query whether or not, the requested store website is available |
|
| 415 | if (isset($this->storeWebsites[$code])) { |
|
| 416 | return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID]; |
|
| 417 | } |
|
| 418 | ||
| 419 | // throw an exception, if not |
|
| 420 | throw new \Exception( |
|
| 421 | $this->appendExceptionSuffix( |
|
| 422 | sprintf('Found invalid website code "%s"', $code) |
|
| 423 | ) |
|
| 424 | ); |
|
| 425 | } |
|
| 426 | ||
| 427 | /** |
|
| 428 | * Return's the category with the passed path. |
|
| @@ 273-287 (lines=15) @@ | ||
| 270 | * @return array The requested entity type |
|
| 271 | * @throws \Exception Is thrown, if the requested entity type is not available |
|
| 272 | */ |
|
| 273 | public function getEntityType() |
|
| 274 | { |
|
| 275 | ||
| 276 | // query whether or not the entity type with the passed code is available |
|
| 277 | if (isset($this->entityTypes[$entityTypeCode = $this->getEntityTypeCode()])) { |
|
| 278 | return $this->entityTypes[$entityTypeCode]; |
|
| 279 | } |
|
| 280 | ||
| 281 | // throw a new exception |
|
| 282 | throw new \Exception( |
|
| 283 | $this->appendExceptionSuffix( |
|
| 284 | sprintf('Requested entity type "%s" is not available', $entityTypeCode) |
|
| 285 | ) |
|
| 286 | ); |
|
| 287 | } |
|
| 288 | ||
| 289 | /** |
|
| 290 | * Merge the columns from the configuration with all image type columns to define which |
|