| @@ 2010-2028 (lines=19) @@ | ||
| 2007 | * |
|
| 2008 | * @return $this|ChildBannerImage The current object (for fluent API support) |
|
| 2009 | */ |
|
| 2010 | public function removeTranslation($locale = 'ru', ConnectionInterface $con = null) |
|
| 2011 | { |
|
| 2012 | if (!$this->isNew()) { |
|
| 2013 | ChildBannerImageI18nQuery::create() |
|
| 2014 | ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale)) |
|
| 2015 | ->delete($con); |
|
| 2016 | } |
|
| 2017 | if (isset($this->currentTranslations[$locale])) { |
|
| 2018 | unset($this->currentTranslations[$locale]); |
|
| 2019 | } |
|
| 2020 | foreach ($this->collBannerImageI18ns as $key => $translation) { |
|
| 2021 | if ($translation->getLocale() == $locale) { |
|
| 2022 | unset($this->collBannerImageI18ns[$key]); |
|
| 2023 | break; |
|
| 2024 | } |
|
| 2025 | } |
|
| 2026 | ||
| 2027 | return $this; |
|
| 2028 | } |
|
| 2029 | ||
| 2030 | /** |
|
| 2031 | * Returns the current translation |
|
| @@ 1958-1976 (lines=19) @@ | ||
| 1955 | * |
|
| 1956 | * @return $this|ChildBanners The current object (for fluent API support) |
|
| 1957 | */ |
|
| 1958 | public function removeTranslation($locale = 'ru', ConnectionInterface $con = null) |
|
| 1959 | { |
|
| 1960 | if (!$this->isNew()) { |
|
| 1961 | ChildBannersI18nQuery::create() |
|
| 1962 | ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale)) |
|
| 1963 | ->delete($con); |
|
| 1964 | } |
|
| 1965 | if (isset($this->currentTranslations[$locale])) { |
|
| 1966 | unset($this->currentTranslations[$locale]); |
|
| 1967 | } |
|
| 1968 | foreach ($this->collBannersI18ns as $key => $translation) { |
|
| 1969 | if ($translation->getLocale() == $locale) { |
|
| 1970 | unset($this->collBannersI18ns[$key]); |
|
| 1971 | break; |
|
| 1972 | } |
|
| 1973 | } |
|
| 1974 | ||
| 1975 | return $this; |
|
| 1976 | } |
|
| 1977 | ||
| 1978 | /** |
|
| 1979 | * Returns the current translation |
|