コード例 #1
0
ファイル: BaseState.php プロジェクト: peterAK/pgs-sts
 /**
  * @param	Store $store The store object to add.
  */
 protected function doAddStore($store)
 {
     $this->collStores[] = $store;
     $store->setState($this);
 }
コード例 #2
0
ファイル: BaseStorePeer.php プロジェクト: peterAK/pgs-sts
 /**
  * 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 Store $obj A Store 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
         StorePeer::$instances[$key] = $obj;
     }
 }
コード例 #3
0
ファイル: BaseStore.php プロジェクト: peterAK/pgs-sts
 /**
  * Exchange the rank of the object with the one passed as argument, and saves both objects
  *
  * @param     Store $object
  * @param     PropelPDO $con optional connection
  *
  * @return    Store the current object
  *
  * @throws Exception if the database cannot execute the two updates
  */
 public function swapWith($object, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(StorePeer::DATABASE_NAME);
     }
     $con->beginTransaction();
     try {
         $oldRank = $this->getSortableRank();
         $newRank = $object->getSortableRank();
         $this->setSortableRank($newRank);
         $this->save($con);
         $object->setSortableRank($oldRank);
         $object->save($con);
         $con->commit();
         return $this;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
コード例 #4
0
ファイル: BaseStateQuery.php プロジェクト: peterAK/pgs-sts
 /**
  * Filter the query by a related Store object
  *
  * @param   Store|PropelObjectCollection $store  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 StateQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByStore($store, $comparison = null)
 {
     if ($store instanceof Store) {
         return $this->addUsingAlias(StatePeer::ID, $store->getStateId(), $comparison);
     } elseif ($store instanceof PropelObjectCollection) {
         return $this->useStoreQuery()->filterByPrimaryKeys($store->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByStore() only accepts arguments of type Store or PropelCollection');
     }
 }
コード例 #5
0
 /**
  * Filter the query by a related Store object
  *
  * @param   Store|PropelObjectCollection $store The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 VisitationQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByStore($store, $comparison = null)
 {
     if ($store instanceof Store) {
         return $this->addUsingAlias(VisitationPeer::STORE_ID, $store->getId(), $comparison);
     } elseif ($store instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(VisitationPeer::STORE_ID, $store->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByStore() only accepts arguments of type Store or PropelCollection');
     }
 }
コード例 #6
0
ファイル: BaseVisitation.php プロジェクト: peterAK/pgs-sts
 /**
  * Resets all references to other model objects or collections of model objects.
  *
  * This method is a user-space workaround for PHP's inability to garbage collect
  * objects with circular references (even in PHP 5.3). This is currently necessary
  * when using Propel in certain daemon or large-volume/high-memory operations.
  *
  * @param boolean $deep Whether to also clear the references on all referrer objects.
  */
 public function clearAllReferences($deep = false)
 {
     if ($deep && !$this->alreadyInClearAllReferencesDeep) {
         $this->alreadyInClearAllReferencesDeep = true;
         if ($this->collTransactions) {
             foreach ($this->collTransactions as $o) {
                 $o->clearAllReferences($deep);
             }
         }
         if ($this->aUser instanceof Persistent) {
             $this->aUser->clearAllReferences($deep);
         }
         if ($this->aStore instanceof Persistent) {
             $this->aStore->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     if ($this->collTransactions instanceof PropelCollection) {
         $this->collTransactions->clearIterator();
     }
     $this->collTransactions = null;
     $this->aUser = null;
     $this->aStore = null;
 }
コード例 #7
0
ファイル: BaseStoreQuery.php プロジェクト: peterAK/pgs-sts
 /**
  * Exclude object from result
  *
  * @param   Store $store Object to remove from the list of results
  *
  * @return StoreQuery The current query, for fluid interface
  */
 public function prune($store = null)
 {
     if ($store) {
         $this->addUsingAlias(StorePeer::ID, $store->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }