/** * 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 ProductArchive $obj A ProductArchive 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 = (string) $obj->getId(); } // if key === null ProductArchivePeer::$instances[$key] = $obj; } }
/** * Exclude object from result * * @param ProductArchive $productArchive Object to remove from the list of results * * @return ProductArchiveQuery The current query, for fluid interface */ public function prune($productArchive = null) { if ($productArchive) { $this->addUsingAlias(ProductArchivePeer::ID, $productArchive->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Populates the the current object based on a $archiveTablePhpName archive object. * * @param ProductArchive $archive An archived object based on the same class * @param Boolean $populateAutoIncrementPrimaryKeys * If true, autoincrement columns are copied from the archive object. * If false, autoincrement columns are left intact. * * @return Product The current object (for fluent API support) */ public function populateFromArchive($archive, $populateAutoIncrementPrimaryKeys = false) { if ($populateAutoIncrementPrimaryKeys) { $this->setId($archive->getId()); } $this->setPrincipalId($archive->getPrincipalId()); $this->setName($archive->getName()); $this->setNameSlug($archive->getNameSlug()); $this->setCategory($archive->getCategory()); $this->setUnit($archive->getUnit()); $this->setPrice($archive->getPrice()); $this->setDescription($archive->getDescription()); $this->setSortableRank($archive->getSortableRank()); $this->setCreatedAt($archive->getCreatedAt()); $this->setUpdatedAt($archive->getUpdatedAt()); return $this; }