コード例 #1
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database. In some cases you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by find*()
  * and findPk*() calls.
  *
  * @param \App\Propel\FileTypeI18n $obj A \App\Propel\FileTypeI18n object.
  * @param string $key             (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if (null === $key) {
             $key = serialize([null === $obj->getFileTypeId() || is_scalar($obj->getFileTypeId()) || is_callable([$obj->getFileTypeId(), '__toString']) ? (string) $obj->getFileTypeId() : $obj->getFileTypeId(), null === $obj->getLocale() || is_scalar($obj->getLocale()) || is_callable([$obj->getLocale(), '__toString']) ? (string) $obj->getLocale() : $obj->getLocale()]);
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
コード例 #2
0
 /**
  * Exclude object from result
  *
  * @param   ChildFileTypeI18n $fileTypeI18n Object to remove from the list of results
  *
  * @return $this|ChildFileTypeI18nQuery The current query, for fluid interface
  */
 public function prune($fileTypeI18n = null)
 {
     if ($fileTypeI18n) {
         $this->addCond('pruneCond0', $this->getAliasedColName(FileTypeI18nTableMap::COL_FILE_TYPE_ID), $fileTypeI18n->getFileTypeId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(FileTypeI18nTableMap::COL_LOCALE), $fileTypeI18n->getLocale(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }
コード例 #3
0
ファイル: FileType.php プロジェクト: mtornero/slowshop
 /**
  * Method called to associate a ChildFileTypeI18n object to this object
  * through the ChildFileTypeI18n foreign key attribute.
  *
  * @param  ChildFileTypeI18n $l ChildFileTypeI18n
  * @return $this|\App\Propel\FileType The current object (for fluent API support)
  */
 public function addFileTypeI18n(ChildFileTypeI18n $l)
 {
     if ($l && ($locale = $l->getLocale())) {
         $this->setLocale($locale);
         $this->currentTranslations[$locale] = $l;
     }
     if ($this->collFileTypeI18ns === null) {
         $this->initFileTypeI18ns();
         $this->collFileTypeI18nsPartial = true;
     }
     if (!$this->collFileTypeI18ns->contains($l)) {
         $this->doAddFileTypeI18n($l);
         if ($this->fileTypeI18nsScheduledForDeletion and $this->fileTypeI18nsScheduledForDeletion->contains($l)) {
             $this->fileTypeI18nsScheduledForDeletion->remove($this->fileTypeI18nsScheduledForDeletion->search($l));
         }
     }
     return $this;
 }