Code Duplication    Length = 22-22 lines in 2 locations

application/modules/core/models/Base/Route.php 2 locations

@@ 1433-1454 (lines=22) @@
1430
     * @param      ConnectionInterface $con Optional connection object
1431
     * @return $this|ChildRoute The current object (for fluent API support)
1432
     */
1433
    public function setSCategories(Collection $sCategories, ConnectionInterface $con = null)
1434
    {
1435
        /** @var SCategory[] $sCategoriesToDelete */
1436
        $sCategoriesToDelete = $this->getSCategories(new Criteria(), $con)->diff($sCategories);
1437
1438
1439
        $this->sCategoriesScheduledForDeletion = $sCategoriesToDelete;
1440
1441
        foreach ($sCategoriesToDelete as $sCategoryRemoved) {
1442
            $sCategoryRemoved->setRoute(null);
1443
        }
1444
1445
        $this->collSCategories = null;
1446
        foreach ($sCategories as $sCategory) {
1447
            $this->addSCategory($sCategory);
1448
        }
1449
1450
        $this->collSCategories = $sCategories;
1451
        $this->collSCategoriesPartial = false;
1452
1453
        return $this;
1454
    }
1455
1456
    /**
1457
     * Returns the number of related BaseSCategory objects.
@@ 1683-1704 (lines=22) @@
1680
     * @param      ConnectionInterface $con Optional connection object
1681
     * @return $this|ChildRoute The current object (for fluent API support)
1682
     */
1683
    public function setSProductss(Collection $sProductss, ConnectionInterface $con = null)
1684
    {
1685
        /** @var SProducts[] $sProductssToDelete */
1686
        $sProductssToDelete = $this->getSProductss(new Criteria(), $con)->diff($sProductss);
1687
1688
1689
        $this->sProductssScheduledForDeletion = $sProductssToDelete;
1690
1691
        foreach ($sProductssToDelete as $sProductsRemoved) {
1692
            $sProductsRemoved->setRoute(null);
1693
        }
1694
1695
        $this->collSProductss = null;
1696
        foreach ($sProductss as $sProducts) {
1697
            $this->addSProducts($sProducts);
1698
        }
1699
1700
        $this->collSProductss = $sProductss;
1701
        $this->collSProductssPartial = false;
1702
1703
        return $this;
1704
    }
1705
1706
    /**
1707
     * Returns the number of related BaseSProducts objects.