/**
  * Exclude object from result
  *
  * @param   ChildImportCategoryI18n $importCategoryI18n Object to remove from the list of results
  *
  * @return ChildImportCategoryI18nQuery The current query, for fluid interface
  */
 public function prune($importCategoryI18n = null)
 {
     if ($importCategoryI18n) {
         $this->addCond('pruneCond0', $this->getAliasedColName(ImportCategoryI18nTableMap::ID), $importCategoryI18n->getId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(ImportCategoryI18nTableMap::LOCALE), $importCategoryI18n->getLocale(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }
Example #2
0
 /**
  * Returns the current translation for a given locale
  *
  * @param     string $locale Locale to use for the translation, e.g. 'fr_FR'
  * @param     ConnectionInterface $con an optional connection object
  *
  * @return ChildImportCategoryI18n */
 public function getTranslation($locale = 'en_US', ConnectionInterface $con = null)
 {
     if (!isset($this->currentTranslations[$locale])) {
         if (null !== $this->collImportCategoryI18ns) {
             foreach ($this->collImportCategoryI18ns as $translation) {
                 if ($translation->getLocale() == $locale) {
                     $this->currentTranslations[$locale] = $translation;
                     return $translation;
                 }
             }
         }
         if ($this->isNew()) {
             $translation = new ChildImportCategoryI18n();
             $translation->setLocale($locale);
         } else {
             $translation = ChildImportCategoryI18nQuery::create()->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))->findOneOrCreate($con);
             $this->currentTranslations[$locale] = $translation;
         }
         $this->addImportCategoryI18n($translation);
     }
     return $this->currentTranslations[$locale];
 }
Example #3
0
 /**
  * Filter the query by a related \Thelia\Model\ImportCategoryI18n object
  *
  * @param \Thelia\Model\ImportCategoryI18n|ObjectCollection $importCategoryI18n  the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildImportCategoryQuery The current query, for fluid interface
  */
 public function filterByImportCategoryI18n($importCategoryI18n, $comparison = null)
 {
     if ($importCategoryI18n instanceof \Thelia\Model\ImportCategoryI18n) {
         return $this->addUsingAlias(ImportCategoryTableMap::ID, $importCategoryI18n->getId(), $comparison);
     } elseif ($importCategoryI18n instanceof ObjectCollection) {
         return $this->useImportCategoryI18nQuery()->filterByPrimaryKeys($importCategoryI18n->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByImportCategoryI18n() only accepts arguments of type \\Thelia\\Model\\ImportCategoryI18n or Collection');
     }
 }