/**
  * Retrieve object using using composite pkey values.
  * @param      int $product_id
  * @param      int $product_category_id
  * @param      PropelPDO $con
  * @return     ProductHasProductCategory
  */
 public static function retrieveByPK($product_id, $product_category_id, PropelPDO $con = null)
 {
     $key = serialize(array((string) $product_id, (string) $product_category_id));
     if (null !== ($obj = ProductHasProductCategoryPeer::getInstanceFromPool($key))) {
         return $obj;
     }
     if ($con === null) {
         $con = Propel::getConnection(ProductHasProductCategoryPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $criteria = new Criteria(ProductHasProductCategoryPeer::DATABASE_NAME);
     $criteria->add(ProductHasProductCategoryPeer::PRODUCT_ID, $product_id);
     $criteria->add(ProductHasProductCategoryPeer::PRODUCT_CATEGORY_ID, $product_category_id);
     $v = ProductHasProductCategoryPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }
 /**
  * Gets an array of ProductHasProductCategory objects which contain a foreign key that references this object.
  *
  * If this collection has already been initialized with an identical Criteria, it returns the collection.
  * Otherwise if this ProductCategory has previously been saved, it will retrieve
  * related ProductHasProductCategorys from storage. If this ProductCategory is new, it will return
  * an empty collection or the current collection, the criteria is ignored on a new object.
  *
  * @param      PropelPDO $con
  * @param      Criteria $criteria
  * @return     array ProductHasProductCategory[]
  * @throws     PropelException
  */
 public function getProductHasProductCategorys($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(ProductCategoryPeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collProductHasProductCategorys === null) {
         if ($this->isNew()) {
             $this->collProductHasProductCategorys = array();
         } else {
             $criteria->add(ProductHasProductCategoryPeer::PRODUCT_CATEGORY_ID, $this->id);
             ProductHasProductCategoryPeer::addSelectColumns($criteria);
             $this->collProductHasProductCategorys = ProductHasProductCategoryPeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(ProductHasProductCategoryPeer::PRODUCT_CATEGORY_ID, $this->id);
             ProductHasProductCategoryPeer::addSelectColumns($criteria);
             if (!isset($this->lastProductHasProductCategoryCriteria) || !$this->lastProductHasProductCategoryCriteria->equals($criteria)) {
                 $this->collProductHasProductCategorys = ProductHasProductCategoryPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastProductHasProductCategoryCriteria = $criteria;
     return $this->collProductHasProductCategorys;
 }