Code Duplication    Length = 21-21 lines in 2 locations

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

@@ 1833-1853 (lines=21) @@
1830
     * @param  ChildBannerImageI18n $l ChildBannerImageI18n
1831
     * @return $this|\xbanners\models\BannerImage The current object (for fluent API support)
1832
     */
1833
    public function addBannerImageI18n(ChildBannerImageI18n $l)
1834
    {
1835
        if ($l && $locale = $l->getLocale()) {
1836
            $this->setLocale($locale);
1837
            $this->currentTranslations[$locale] = $l;
1838
        }
1839
        if ($this->collBannerImageI18ns === null) {
1840
            $this->initBannerImageI18ns();
1841
            $this->collBannerImageI18nsPartial = true;
1842
        }
1843
1844
        if (!$this->collBannerImageI18ns->contains($l)) {
1845
            $this->doAddBannerImageI18n($l);
1846
1847
            if ($this->bannerImageI18nsScheduledForDeletion and $this->bannerImageI18nsScheduledForDeletion->contains($l)) {
1848
                $this->bannerImageI18nsScheduledForDeletion->remove($this->bannerImageI18nsScheduledForDeletion->search($l));
1849
            }
1850
        }
1851
1852
        return $this;
1853
    }
1854
1855
    /**
1856
     * @param ChildBannerImageI18n $bannerImageI18n The ChildBannerImageI18n object to add.

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

@@ 1783-1803 (lines=21) @@
1780
     * @param  ChildBannersI18n $l ChildBannersI18n
1781
     * @return $this|\xbanners\models\Banners The current object (for fluent API support)
1782
     */
1783
    public function addBannersI18n(ChildBannersI18n $l)
1784
    {
1785
        if ($l && $locale = $l->getLocale()) {
1786
            $this->setLocale($locale);
1787
            $this->currentTranslations[$locale] = $l;
1788
        }
1789
        if ($this->collBannersI18ns === null) {
1790
            $this->initBannersI18ns();
1791
            $this->collBannersI18nsPartial = true;
1792
        }
1793
1794
        if (!$this->collBannersI18ns->contains($l)) {
1795
            $this->doAddBannersI18n($l);
1796
1797
            if ($this->bannersI18nsScheduledForDeletion and $this->bannersI18nsScheduledForDeletion->contains($l)) {
1798
                $this->bannersI18nsScheduledForDeletion->remove($this->bannersI18nsScheduledForDeletion->search($l));
1799
            }
1800
        }
1801
1802
        return $this;
1803
    }
1804
1805
    /**
1806
     * @param ChildBannersI18n $bannersI18n The ChildBannersI18n object to add.