| @@ 269-286 (lines=18) @@ | ||
| 266 | * @return integer The requested visibility key |
|
| 267 | * @throws \Exception Is thrown, if the requested visibility is not available |
|
| 268 | */ |
|
| 269 | public function getVisibilityIdByValue($visibility) |
|
| 270 | { |
|
| 271 | ||
| 272 | // query whether or not, the requested visibility is available |
|
| 273 | if (isset($this->availableVisibilities[$visibility])) { |
|
| 274 | return $this->availableVisibilities[$visibility]; |
|
| 275 | } |
|
| 276 | ||
| 277 | // throw an exception, if not |
|
| 278 | throw new \Exception( |
|
| 279 | sprintf( |
|
| 280 | 'Found invalid visibility %s in file %s on line %d', |
|
| 281 | $visibility, |
|
| 282 | $this->getFilename(), |
|
| 283 | $this->getLineNumber() |
|
| 284 | ) |
|
| 285 | ); |
|
| 286 | } |
|
| 287 | ||
| 288 | /** |
|
| 289 | * Add the passed category ID to the product's category list. |
|
| @@ 450-467 (lines=18) @@ | ||
| 447 | * @return integer The tax class ID |
|
| 448 | * @throws \Exception Is thrown, if the tax class with the requested name is not available |
|
| 449 | */ |
|
| 450 | public function getTaxClassIdByTaxClassName($taxClassName) |
|
| 451 | { |
|
| 452 | ||
| 453 | // query whether or not, the requested tax class is available |
|
| 454 | if (isset($this->taxClasses[$taxClassName])) { |
|
| 455 | return (integer) $this->taxClasses[$taxClassName][MemberNames::CLASS_ID]; |
|
| 456 | } |
|
| 457 | ||
| 458 | // throw an exception, if not |
|
| 459 | throw new \Exception( |
|
| 460 | sprintf( |
|
| 461 | 'Found invalid tax class name %s in file %s on line %d', |
|
| 462 | $taxClassName, |
|
| 463 | $this->getFilename(), |
|
| 464 | $this->getLineNumber() |
|
| 465 | ) |
|
| 466 | ); |
|
| 467 | } |
|
| 468 | ||
| 469 | /** |
|
| 470 | * Return's the store website for the passed code. |
|
| @@ 477-494 (lines=18) @@ | ||
| 474 | * @return integer The store website ID |
|
| 475 | * @throws \Exception Is thrown, if the store website with the requested code is not available |
|
| 476 | */ |
|
| 477 | public function getStoreWebsiteIdByCode($code) |
|
| 478 | { |
|
| 479 | ||
| 480 | // query whether or not, the requested store website is available |
|
| 481 | if (isset($this->storeWebsites[$code])) { |
|
| 482 | return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID]; |
|
| 483 | } |
|
| 484 | ||
| 485 | // throw an exception, if not |
|
| 486 | throw new \Exception( |
|
| 487 | sprintf( |
|
| 488 | 'Found invalid website code %s in file %s on line %d', |
|
| 489 | $code, |
|
| 490 | $this->getFilename(), |
|
| 491 | $this->getLineNumber() |
|
| 492 | ) |
|
| 493 | ); |
|
| 494 | } |
|
| 495 | ||
| 496 | /** |
|
| 497 | * Return's the attribute set with the passed attribute set name. |
|
| @@ 504-521 (lines=18) @@ | ||
| 501 | * @return array The attribute set data |
|
| 502 | * @throws \Exception Is thrown, if the attribute set with the passed name is not available |
|
| 503 | */ |
|
| 504 | public function getAttributeSetByAttributeSetName($attributeSetName) |
|
| 505 | { |
|
| 506 | ||
| 507 | // query whether or not, the requested attribute set is available |
|
| 508 | if (isset($this->attributeSets[$attributeSetName])) { |
|
| 509 | return $this->attributeSets[$attributeSetName]; |
|
| 510 | } |
|
| 511 | ||
| 512 | // throw an exception, if not |
|
| 513 | throw new \Exception( |
|
| 514 | sprintf( |
|
| 515 | 'Found invalid attribute set name %s in file %s on line %d', |
|
| 516 | $attributeSetName, |
|
| 517 | $this->getFilename(), |
|
| 518 | $this->getLineNumber() |
|
| 519 | ) |
|
| 520 | ); |
|
| 521 | } |
|
| 522 | ||
| 523 | /** |
|
| 524 | * Return's the category with the passed path. |
|
| @@ 531-548 (lines=18) @@ | ||
| 528 | * @return array The category |
|
| 529 | * @throws \Exception Is thrown, if the requested category is not available |
|
| 530 | */ |
|
| 531 | public function getCategoryByPath($path) |
|
| 532 | { |
|
| 533 | ||
| 534 | // query whether or not the category with the passed path exists |
|
| 535 | if (isset($this->categories[$path])) { |
|
| 536 | return $this->categories[$path]; |
|
| 537 | } |
|
| 538 | ||
| 539 | // throw an exception, if not |
|
| 540 | throw new \Exception( |
|
| 541 | sprintf( |
|
| 542 | 'Can\'t find category with path %s in file %s on line %d', |
|
| 543 | $path, |
|
| 544 | $this->getFilename(), |
|
| 545 | $this->getLineNumber() |
|
| 546 | ) |
|
| 547 | ); |
|
| 548 | } |
|
| 549 | ||
| 550 | /** |
|
| 551 | * Return's the category with the passed ID. |
|