| @@ 443-457 (lines=15) @@ | ||
| 440 | * @return integer The tax class ID |
|
| 441 | * @throws \Exception Is thrown, if the tax class with the requested name is not available |
|
| 442 | */ |
|
| 443 | public function getTaxClassIdByTaxClassName($taxClassName) |
|
| 444 | { |
|
| 445 | ||
| 446 | // query whether or not, the requested tax class is available |
|
| 447 | if (isset($this->taxClasses[$taxClassName])) { |
|
| 448 | return (integer) $this->taxClasses[$taxClassName][MemberNames::CLASS_ID]; |
|
| 449 | } |
|
| 450 | ||
| 451 | // throw an exception, if not |
|
| 452 | throw new \Exception( |
|
| 453 | $this->appendExceptionSuffix( |
|
| 454 | sprintf('Found invalid tax class name %s', $taxClassName) |
|
| 455 | ) |
|
| 456 | ); |
|
| 457 | } |
|
| 458 | ||
| 459 | /** |
|
| 460 | * Return's the store website for the passed code. |
|
| @@ 467-481 (lines=15) @@ | ||
| 464 | * @return integer The store website ID |
|
| 465 | * @throws \Exception Is thrown, if the store website with the requested code is not available |
|
| 466 | */ |
|
| 467 | public function getStoreWebsiteIdByCode($code) |
|
| 468 | { |
|
| 469 | ||
| 470 | // query whether or not, the requested store website is available |
|
| 471 | if (isset($this->storeWebsites[$code])) { |
|
| 472 | return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID]; |
|
| 473 | } |
|
| 474 | ||
| 475 | // throw an exception, if not |
|
| 476 | throw new \Exception( |
|
| 477 | $this->appendExceptionSuffix( |
|
| 478 | sprintf('Found invalid website code %s', $code) |
|
| 479 | ) |
|
| 480 | ); |
|
| 481 | } |
|
| 482 | ||
| 483 | /** |
|
| 484 | * Return's the category with the passed path. |
|
| @@ 697-711 (lines=15) @@ | ||
| 694 | * @return integer The mapped link type ID |
|
| 695 | * @throws \TechDivision\Import\Product\Exceptions\MapLinkTypeCodeToIdException Is thrown if the link type code is not mapped yet |
|
| 696 | */ |
|
| 697 | public function mapLinkTypeCodeToLinkTypeId($linkTypeCode) |
|
| 698 | { |
|
| 699 | ||
| 700 | // query weather or not the link type code has been mapped |
|
| 701 | if (isset($this->linkTypes[$linkTypeCode])) { |
|
| 702 | return $this->linkTypes[$linkTypeCode][MemberNames::LINK_TYPE_ID]; |
|
| 703 | } |
|
| 704 | ||
| 705 | // throw an exception if the link type code has not been mapped yet |
|
| 706 | throw new MapLinkTypeCodeToIdException( |
|
| 707 | $this->appendExceptionSuffix( |
|
| 708 | sprintf('Found not mapped link type code %s', $linkTypeCode) |
|
| 709 | ) |
|
| 710 | ); |
|
| 711 | } |
|
| 712 | ||
| 713 | /** |
|
| 714 | * Return's the link attribute for the passed link type ID and attribute code. |
|
| @@ 305-319 (lines=15) @@ | ||
| 302 | * @return array The requested entity type |
|
| 303 | * @throws \Exception Is thrown, if the requested entity type is not available |
|
| 304 | */ |
|
| 305 | public function getEntityType() |
|
| 306 | { |
|
| 307 | ||
| 308 | // query whether or not the entity type with the passed code is available |
|
| 309 | if (isset($this->entityTypes[$entityTypeCode = $this->getEntityTypeCode()])) { |
|
| 310 | return $this->entityTypes[$entityTypeCode]; |
|
| 311 | } |
|
| 312 | ||
| 313 | // throw a new exception |
|
| 314 | throw new \Exception( |
|
| 315 | $this->appendExceptionSuffix( |
|
| 316 | sprintf('Requested entity type "%s" is not available', $entityTypeCode) |
|
| 317 | ) |
|
| 318 | ); |
|
| 319 | } |
|
| 320 | ||
| 321 | /** |
|
| 322 | * Return's TRUE, if the passed URL key varchar value IS related with the actual PK. |
|