Code Duplication    Length = 15-15 lines in 2 locations

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

@@ 1586-1600 (lines=15) @@
1583
     * @param  ChildBannerImage $bannerImage The ChildBannerImage object to remove.
1584
     * @return $this|ChildBanners The current object (for fluent API support)
1585
     */
1586
    public function removeBannerImage(ChildBannerImage $bannerImage)
1587
    {
1588
        if ($this->getBannerImages()->contains($bannerImage)) {
1589
            $pos = $this->collBannerImages->search($bannerImage);
1590
            $this->collBannerImages->remove($pos);
1591
            if (null === $this->bannerImagesScheduledForDeletion) {
1592
                $this->bannerImagesScheduledForDeletion = clone $this->collBannerImages;
1593
                $this->bannerImagesScheduledForDeletion->clear();
1594
            }
1595
            $this->bannerImagesScheduledForDeletion[]= clone $bannerImage;
1596
            $bannerImage->setBanners(null);
1597
        }
1598
1599
        return $this;
1600
    }
1601
1602
    /**
1603
     * Clears out the collBannersI18ns collection
@@ 1818-1832 (lines=15) @@
1815
     * @param  ChildBannersI18n $bannersI18n The ChildBannersI18n object to remove.
1816
     * @return $this|ChildBanners The current object (for fluent API support)
1817
     */
1818
    public function removeBannersI18n(ChildBannersI18n $bannersI18n)
1819
    {
1820
        if ($this->getBannersI18ns()->contains($bannersI18n)) {
1821
            $pos = $this->collBannersI18ns->search($bannersI18n);
1822
            $this->collBannersI18ns->remove($pos);
1823
            if (null === $this->bannersI18nsScheduledForDeletion) {
1824
                $this->bannersI18nsScheduledForDeletion = clone $this->collBannersI18ns;
1825
                $this->bannersI18nsScheduledForDeletion->clear();
1826
            }
1827
            $this->bannersI18nsScheduledForDeletion[]= clone $bannersI18n;
1828
            $bannersI18n->setBanners(null);
1829
        }
1830
1831
        return $this;
1832
    }
1833
1834
    /**
1835
     * Clears the current object, sets all attributes to their default values and removes