Code Duplication    Length = 11-14 lines in 3 locations

src/Subjects/AbstractProductSubject.php 3 locations

@@ 311-324 (lines=14) @@
308
     * @return integer The ID of the actual store
309
     * @throws \Exception Is thrown, if the store with the actual code is not available
310
     */
311
    public function getRowStoreId()
312
    {
313
314
        // load the store view code the create the product/attributes for
315
        $storeViewCode = $this->getStoreViewCode(StoreViewCodes::ADMIN);
316
317
        // query whether or not, the requested store is available
318
        if (isset($this->stores[$storeViewCode])) {
319
            return (integer) $this->stores[$storeViewCode][MemberNames::STORE_ID];
320
        }
321
322
        // throw an exception, if not
323
        throw new \Exception(sprintf('Found invalid store view code %s', $storeViewCode));
324
    }
325
326
    /**
327
     * Return's the tax class ID for the passed tax class name.
@@ 334-344 (lines=11) @@
331
     * @return integer The tax class ID
332
     * @throws \Exception Is thrown, if the tax class with the requested name is not available
333
     */
334
    public function getTaxClassIdByTaxClassName($taxClassName)
335
    {
336
337
        // query whether or not, the requested tax class is available
338
        if (isset($this->taxClasses[$taxClassName])) {
339
            return (integer) $this->taxClasses[$taxClassName][MemberNames::CLASS_ID];
340
        }
341
342
        // throw an exception, if not
343
        throw new \Exception(sprintf('Found invalid tax class name %s', $taxClassName));
344
    }
345
346
    /**
347
     * Return's the store website for the passed code.
@@ 354-364 (lines=11) @@
351
     * @return integer The store website ID
352
     * @throws \Exception Is thrown, if the store website with the requested code is not available
353
     */
354
    public function getStoreWebsiteIdByCode($code)
355
    {
356
357
        // query whether or not, the requested store website is available
358
        if (isset($this->storeWebsites[$code])) {
359
            return (integer) $this->storeWebsites[$code][MemberNames::WEBSITE_ID];
360
        }
361
362
        // throw an exception, if not
363
        throw new \Exception(sprintf('Found invalid website code %s', $code));
364
    }
365
366
    /**
367
     * Return's the attribute set with the passed attribute set name.