| @@ 1828-1848 (lines=21) @@ | ||
| 1825 | * @param ChildBannerImageI18n $l ChildBannerImageI18n |
|
| 1826 | * @return $this|\xbanners\models\BannerImage The current object (for fluent API support) |
|
| 1827 | */ |
|
| 1828 | public function addBannerImageI18n(ChildBannerImageI18n $l) |
|
| 1829 | { |
|
| 1830 | if ($l && $locale = $l->getLocale()) { |
|
| 1831 | $this->setLocale($locale); |
|
| 1832 | $this->currentTranslations[$locale] = $l; |
|
| 1833 | } |
|
| 1834 | if ($this->collBannerImageI18ns === null) { |
|
| 1835 | $this->initBannerImageI18ns(); |
|
| 1836 | $this->collBannerImageI18nsPartial = true; |
|
| 1837 | } |
|
| 1838 | ||
| 1839 | if (!$this->collBannerImageI18ns->contains($l)) { |
|
| 1840 | $this->doAddBannerImageI18n($l); |
|
| 1841 | ||
| 1842 | if ($this->bannerImageI18nsScheduledForDeletion and $this->bannerImageI18nsScheduledForDeletion->contains($l)) { |
|
| 1843 | $this->bannerImageI18nsScheduledForDeletion->remove($this->bannerImageI18nsScheduledForDeletion->search($l)); |
|
| 1844 | } |
|
| 1845 | } |
|
| 1846 | ||
| 1847 | return $this; |
|
| 1848 | } |
|
| 1849 | ||
| 1850 | /** |
|
| 1851 | * @param ChildBannerImageI18n $bannerImageI18n The ChildBannerImageI18n object to add. |
|
| @@ 1778-1798 (lines=21) @@ | ||
| 1775 | * @param ChildBannersI18n $l ChildBannersI18n |
|
| 1776 | * @return $this|\xbanners\models\Banners The current object (for fluent API support) |
|
| 1777 | */ |
|
| 1778 | public function addBannersI18n(ChildBannersI18n $l) |
|
| 1779 | { |
|
| 1780 | if ($l && $locale = $l->getLocale()) { |
|
| 1781 | $this->setLocale($locale); |
|
| 1782 | $this->currentTranslations[$locale] = $l; |
|
| 1783 | } |
|
| 1784 | if ($this->collBannersI18ns === null) { |
|
| 1785 | $this->initBannersI18ns(); |
|
| 1786 | $this->collBannersI18nsPartial = true; |
|
| 1787 | } |
|
| 1788 | ||
| 1789 | if (!$this->collBannersI18ns->contains($l)) { |
|
| 1790 | $this->doAddBannersI18n($l); |
|
| 1791 | ||
| 1792 | if ($this->bannersI18nsScheduledForDeletion and $this->bannersI18nsScheduledForDeletion->contains($l)) { |
|
| 1793 | $this->bannersI18nsScheduledForDeletion->remove($this->bannersI18nsScheduledForDeletion->search($l)); |
|
| 1794 | } |
|
| 1795 | } |
|
| 1796 | ||
| 1797 | return $this; |
|
| 1798 | } |
|
| 1799 | ||
| 1800 | /** |
|
| 1801 | * @param ChildBannersI18n $bannersI18n The ChildBannersI18n object to add. |
|