示例#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 -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param HelpI18n $obj A HelpI18n 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 ($key === null) {
             $key = serialize(array((string) $obj->getId(), (string) $obj->getLocale()));
         }
         // if key === null
         HelpI18nPeer::$instances[$key] = $obj;
     }
 }
示例#2
0
 /**
  * Exclude object from result
  *
  * @param   HelpI18n $helpI18n Object to remove from the list of results
  *
  * @return HelpI18nQuery The current query, for fluid interface
  */
 public function prune($helpI18n = null)
 {
     if ($helpI18n) {
         $this->addCond('pruneCond0', $this->getAliasedColName(HelpI18nPeer::ID), $helpI18n->getId(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(HelpI18nPeer::LOCALE), $helpI18n->getLocale(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }
示例#3
0
 /**
  * Method called to associate a HelpI18n object to this object
  * through the HelpI18n foreign key attribute.
  *
  * @param    HelpI18n $l HelpI18n
  * @return Help The current object (for fluent API support)
  */
 public function addHelpI18n(HelpI18n $l)
 {
     if ($l && ($locale = $l->getLocale())) {
         $this->setLocale($locale);
         $this->currentTranslations[$locale] = $l;
     }
     if ($this->collHelpI18ns === null) {
         $this->initHelpI18ns();
         $this->collHelpI18nsPartial = true;
     }
     if (!in_array($l, $this->collHelpI18ns->getArrayCopy(), true)) {
         // only add it if the **same** object is not already associated
         $this->doAddHelpI18n($l);
         if ($this->helpI18nsScheduledForDeletion and $this->helpI18nsScheduledForDeletion->contains($l)) {
             $this->helpI18nsScheduledForDeletion->remove($this->helpI18nsScheduledForDeletion->search($l));
         }
     }
     return $this;
 }