Code Duplication    Length = 43-43 lines in 5 locations

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

@@ 1383-1425 (lines=43) @@
1380
     * @return ObjectCollection|SCategory[] List of SCategory objects
1381
     * @throws PropelException
1382
     */
1383
    public function getSCategories(Criteria $criteria = null, ConnectionInterface $con = null)
1384
    {
1385
        $partial = $this->collSCategoriesPartial && !$this->isNew();
1386
        if (null === $this->collSCategories || null !== $criteria  || $partial) {
1387
            if ($this->isNew() && null === $this->collSCategories) {
1388
                // return empty collection
1389
                $this->initSCategories();
1390
            } else {
1391
                $collSCategories = SCategoryQuery::create(null, $criteria)
1392
                    ->filterByRoute($this)
1393
                    ->find($con);
1394
1395
                if (null !== $criteria) {
1396
                    if (false !== $this->collSCategoriesPartial && count($collSCategories)) {
1397
                        $this->initSCategories(false);
1398
1399
                        foreach ($collSCategories as $obj) {
1400
                            if (false == $this->collSCategories->contains($obj)) {
1401
                                $this->collSCategories->append($obj);
1402
                            }
1403
                        }
1404
1405
                        $this->collSCategoriesPartial = true;
1406
                    }
1407
1408
                    return $collSCategories;
1409
                }
1410
1411
                if ($partial && $this->collSCategories) {
1412
                    foreach ($this->collSCategories as $obj) {
1413
                        if ($obj->isNew()) {
1414
                            $collSCategories[] = $obj;
1415
                        }
1416
                    }
1417
                }
1418
1419
                $this->collSCategories = $collSCategories;
1420
                $this->collSCategoriesPartial = false;
1421
            }
1422
        }
1423
1424
        return $this->collSCategories;
1425
    }
1426
1427
    /**
1428
     * Sets a collection of SCategory objects related by a one-to-many relationship
@@ 1633-1675 (lines=43) @@
1630
     * @return ObjectCollection|SProducts[] List of SProducts objects
1631
     * @throws PropelException
1632
     */
1633
    public function getSProductss(Criteria $criteria = null, ConnectionInterface $con = null)
1634
    {
1635
        $partial = $this->collSProductssPartial && !$this->isNew();
1636
        if (null === $this->collSProductss || null !== $criteria  || $partial) {
1637
            if ($this->isNew() && null === $this->collSProductss) {
1638
                // return empty collection
1639
                $this->initSProductss();
1640
            } else {
1641
                $collSProductss = SProductsQuery::create(null, $criteria)
1642
                    ->filterByRoute($this)
1643
                    ->find($con);
1644
1645
                if (null !== $criteria) {
1646
                    if (false !== $this->collSProductssPartial && count($collSProductss)) {
1647
                        $this->initSProductss(false);
1648
1649
                        foreach ($collSProductss as $obj) {
1650
                            if (false == $this->collSProductss->contains($obj)) {
1651
                                $this->collSProductss->append($obj);
1652
                            }
1653
                        }
1654
1655
                        $this->collSProductssPartial = true;
1656
                    }
1657
1658
                    return $collSProductss;
1659
                }
1660
1661
                if ($partial && $this->collSProductss) {
1662
                    foreach ($this->collSProductss as $obj) {
1663
                        if ($obj->isNew()) {
1664
                            $collSProductss[] = $obj;
1665
                        }
1666
                    }
1667
                }
1668
1669
                $this->collSProductss = $collSProductss;
1670
                $this->collSProductssPartial = false;
1671
            }
1672
        }
1673
1674
        return $this->collSProductss;
1675
    }
1676
1677
    /**
1678
     * Sets a collection of SProducts objects related by a one-to-many relationship

application/modules/xbanners/models/Base/BannerImage.php 1 location

@@ 1712-1754 (lines=43) @@
1709
     * @return ObjectCollection|ChildBannerImageI18n[] List of ChildBannerImageI18n objects
1710
     * @throws PropelException
1711
     */
1712
    public function getBannerImageI18ns(Criteria $criteria = null, ConnectionInterface $con = null)
1713
    {
1714
        $partial = $this->collBannerImageI18nsPartial && !$this->isNew();
1715
        if (null === $this->collBannerImageI18ns || null !== $criteria  || $partial) {
1716
            if ($this->isNew() && null === $this->collBannerImageI18ns) {
1717
                // return empty collection
1718
                $this->initBannerImageI18ns();
1719
            } else {
1720
                $collBannerImageI18ns = ChildBannerImageI18nQuery::create(null, $criteria)
1721
                    ->filterByBannerImage($this)
1722
                    ->find($con);
1723
1724
                if (null !== $criteria) {
1725
                    if (false !== $this->collBannerImageI18nsPartial && count($collBannerImageI18ns)) {
1726
                        $this->initBannerImageI18ns(false);
1727
1728
                        foreach ($collBannerImageI18ns as $obj) {
1729
                            if (false == $this->collBannerImageI18ns->contains($obj)) {
1730
                                $this->collBannerImageI18ns->append($obj);
1731
                            }
1732
                        }
1733
1734
                        $this->collBannerImageI18nsPartial = true;
1735
                    }
1736
1737
                    return $collBannerImageI18ns;
1738
                }
1739
1740
                if ($partial && $this->collBannerImageI18ns) {
1741
                    foreach ($this->collBannerImageI18ns as $obj) {
1742
                        if ($obj->isNew()) {
1743
                            $collBannerImageI18ns[] = $obj;
1744
                        }
1745
                    }
1746
                }
1747
1748
                $this->collBannerImageI18ns = $collBannerImageI18ns;
1749
                $this->collBannerImageI18nsPartial = false;
1750
            }
1751
        }
1752
1753
        return $this->collBannerImageI18ns;
1754
    }
1755
1756
    /**
1757
     * Sets a collection of ChildBannerImageI18n objects related by a one-to-many relationship

application/modules/xbanners/models/Base/Banners.php 2 locations

@@ 1437-1479 (lines=43) @@
1434
     * @return ObjectCollection|ChildBannerImage[] List of ChildBannerImage objects
1435
     * @throws PropelException
1436
     */
1437
    public function getBannerImages(Criteria $criteria = null, ConnectionInterface $con = null)
1438
    {
1439
        $partial = $this->collBannerImagesPartial && !$this->isNew();
1440
        if (null === $this->collBannerImages || null !== $criteria  || $partial) {
1441
            if ($this->isNew() && null === $this->collBannerImages) {
1442
                // return empty collection
1443
                $this->initBannerImages();
1444
            } else {
1445
                $collBannerImages = ChildBannerImageQuery::create(null, $criteria)
1446
                    ->filterByBanners($this)
1447
                    ->find($con);
1448
1449
                if (null !== $criteria) {
1450
                    if (false !== $this->collBannerImagesPartial && count($collBannerImages)) {
1451
                        $this->initBannerImages(false);
1452
1453
                        foreach ($collBannerImages as $obj) {
1454
                            if (false == $this->collBannerImages->contains($obj)) {
1455
                                $this->collBannerImages->append($obj);
1456
                            }
1457
                        }
1458
1459
                        $this->collBannerImagesPartial = true;
1460
                    }
1461
1462
                    return $collBannerImages;
1463
                }
1464
1465
                if ($partial && $this->collBannerImages) {
1466
                    foreach ($this->collBannerImages as $obj) {
1467
                        if ($obj->isNew()) {
1468
                            $collBannerImages[] = $obj;
1469
                        }
1470
                    }
1471
                }
1472
1473
                $this->collBannerImages = $collBannerImages;
1474
                $this->collBannerImagesPartial = false;
1475
            }
1476
        }
1477
1478
        return $this->collBannerImages;
1479
    }
1480
1481
    /**
1482
     * Sets a collection of ChildBannerImage objects related by a one-to-many relationship
@@ 1662-1704 (lines=43) @@
1659
     * @return ObjectCollection|ChildBannersI18n[] List of ChildBannersI18n objects
1660
     * @throws PropelException
1661
     */
1662
    public function getBannersI18ns(Criteria $criteria = null, ConnectionInterface $con = null)
1663
    {
1664
        $partial = $this->collBannersI18nsPartial && !$this->isNew();
1665
        if (null === $this->collBannersI18ns || null !== $criteria  || $partial) {
1666
            if ($this->isNew() && null === $this->collBannersI18ns) {
1667
                // return empty collection
1668
                $this->initBannersI18ns();
1669
            } else {
1670
                $collBannersI18ns = ChildBannersI18nQuery::create(null, $criteria)
1671
                    ->filterByBanners($this)
1672
                    ->find($con);
1673
1674
                if (null !== $criteria) {
1675
                    if (false !== $this->collBannersI18nsPartial && count($collBannersI18ns)) {
1676
                        $this->initBannersI18ns(false);
1677
1678
                        foreach ($collBannersI18ns as $obj) {
1679
                            if (false == $this->collBannersI18ns->contains($obj)) {
1680
                                $this->collBannersI18ns->append($obj);
1681
                            }
1682
                        }
1683
1684
                        $this->collBannersI18nsPartial = true;
1685
                    }
1686
1687
                    return $collBannersI18ns;
1688
                }
1689
1690
                if ($partial && $this->collBannersI18ns) {
1691
                    foreach ($this->collBannersI18ns as $obj) {
1692
                        if ($obj->isNew()) {
1693
                            $collBannersI18ns[] = $obj;
1694
                        }
1695
                    }
1696
                }
1697
1698
                $this->collBannersI18ns = $collBannersI18ns;
1699
                $this->collBannersI18nsPartial = false;
1700
            }
1701
        }
1702
1703
        return $this->collBannersI18ns;
1704
    }
1705
1706
    /**
1707
     * Sets a collection of ChildBannersI18n objects related by a one-to-many relationship