Code Duplication    Length = 43-43 lines in 5 locations

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

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

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

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

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

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