Code Duplication    Length = 15-15 lines in 4 locations

src/Subjects/AbstractProductSubject.php 3 locations

@@ 436-450 (lines=15) @@
433
     * @return integer The tax class ID
434
     * @throws \Exception Is thrown, if the tax class with the requested name is not available
435
     */
436
    public function getTaxClassIdByTaxClassName($taxClassName)
437
    {
438
439
        // query whether or not, the requested tax class is available
440
        if (isset($this->taxClasses[$taxClassName])) {
441
            return (integer) $this->taxClasses[$taxClassName][MemberNames::CLASS_ID];
442
        }
443
444
        // throw an exception, if not
445
        throw new \Exception(
446
            $this->appendExceptionSuffix(
447
                sprintf('Found invalid tax class name %s', $taxClassName)
448
            )
449
        );
450
    }
451
452
    /**
453
     * Return's the store website for the passed code.
@@ 460-474 (lines=15) @@
457
     * @return integer The store website ID
458
     * @throws \Exception Is thrown, if the store website with the requested code is not available
459
     */
460
    public function getStoreWebsiteIdByCode($code)
461
    {
462
463
        // query whether or not, the requested store website is available
464
        if (isset($this->storeWebsites[$code])) {
465
            return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID];
466
        }
467
468
        // throw an exception, if not
469
        throw new \Exception(
470
            $this->appendExceptionSuffix(
471
                sprintf('Found invalid website code %s', $code)
472
            )
473
        );
474
    }
475
476
    /**
477
     * Return's the category with the passed path.
@@ 718-732 (lines=15) @@
715
     * @return integer The mapped link type ID
716
     * @throws \TechDivision\Import\Product\Exceptions\MapLinkTypeCodeToIdException Is thrown if the link type code is not mapped yet
717
     */
718
    public function mapLinkTypeCodeToLinkTypeId($linkTypeCode)
719
    {
720
721
        // query weather or not the link type code has been mapped
722
        if (isset($this->linkTypes[$linkTypeCode])) {
723
            return $this->linkTypes[$linkTypeCode][MemberNames::LINK_TYPE_ID];
724
        }
725
726
        // throw an exception if the link type code has not been mapped yet
727
        throw new MapLinkTypeCodeToIdException(
728
            $this->appendExceptionSuffix(
729
                sprintf('Found not mapped link type code %s', $linkTypeCode)
730
            )
731
        );
732
    }
733
734
    /**
735
     * Return's the link attribute for the passed link type ID and attribute code.

src/Subjects/BunchSubject.php 1 location

@@ 313-327 (lines=15) @@
310
     * @return array The requested entity type
311
     * @throws \Exception Is thrown, if the requested entity type is not available
312
     */
313
    public function getEntityType()
314
    {
315
316
        // query whether or not the entity type with the passed code is available
317
        if (isset($this->entityTypes[$entityTypeCode = $this->getEntityTypeCode()])) {
318
            return $this->entityTypes[$entityTypeCode];
319
        }
320
321
        // throw a new exception
322
        throw new \Exception(
323
            $this->appendExceptionSuffix(
324
                sprintf('Requested entity type "%s" is not available', $entityTypeCode)
325
            )
326
        );
327
    }
328
329
    /**
330
     * Return's TRUE, if the passed URL key varchar value IS related with the actual PK.