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.
@@ 702-716 (lines=15) @@
699
     * @return integer The mapped link type ID
700
     * @throws \TechDivision\Import\Product\Exceptions\MapLinkTypeCodeToIdException Is thrown if the link type code is not mapped yet
701
     */
702
    public function mapLinkTypeCodeToLinkTypeId($linkTypeCode)
703
    {
704
705
        // query weather or not the link type code has been mapped
706
        if (isset($this->linkTypes[$linkTypeCode])) {
707
            return $this->linkTypes[$linkTypeCode][MemberNames::LINK_TYPE_ID];
708
        }
709
710
        // throw an exception if the link type code has not been mapped yet
711
        throw new MapLinkTypeCodeToIdException(
712
            $this->appendExceptionSuffix(
713
                sprintf('Found not mapped link type code %s', $linkTypeCode)
714
            )
715
        );
716
    }
717
718
    /**
719
     * Return's the link attribute for the passed link type ID and attribute code.

src/Subjects/BunchSubject.php 1 location

@@ 260-274 (lines=15) @@
257
     * @return array The requested entity type
258
     * @throws \Exception Is thrown, if the requested entity type is not available
259
     */
260
    public function getEntityType()
261
    {
262
263
        // query whether or not the entity type with the passed code is available
264
        if (isset($this->entityTypes[$entityTypeCode = $this->getEntityTypeCode()])) {
265
            return $this->entityTypes[$entityTypeCode];
266
        }
267
268
        // throw a new exception
269
        throw new \Exception(
270
            $this->appendExceptionSuffix(
271
                sprintf('Requested entity type "%s" is not available', $entityTypeCode)
272
            )
273
        );
274
    }
275
276
    /**
277
     * Return's TRUE, if the passed URL key varchar value IS related with the actual PK.