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