コード例 #1
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;
     }
 }
コード例 #2
0
ファイル: BaseVisitation.php プロジェクト: peterAK/pgs-sts
 /**
  * Declares an association between this object and a Store object.
  *
  * @param                  Store $v
  * @return Visitation The current object (for fluent API support)
  * @throws PropelException
  */
 public function setStore(Store $v = null)
 {
     if ($v === null) {
         $this->setStoreId(NULL);
     } else {
         $this->setStoreId($v->getId());
     }
     $this->aStore = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Store object, it will not be re-added.
     if ($v !== null) {
         $v->addVisitation($this);
     }
     return $this;
 }
コード例 #3
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');
     }
 }
コード例 #4
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;
 }