コード例 #1
0
 /**
 * Retrieve object using using composite pkey values.
 * @param      int $room_id
   @param      int $featurevalue_id
   
 * @param      PropelPDO $con
 * @return     RoomHasFeaturevalue
 */
 public static function retrieveByPK($room_id, $featurevalue_id, PropelPDO $con = null)
 {
     $key = serialize(array((string) $room_id, (string) $featurevalue_id));
     if (null !== ($obj = RoomHasFeaturevaluePeer::getInstanceFromPool($key))) {
         return $obj;
     }
     if ($con === null) {
         $con = Propel::getConnection(RoomHasFeaturevaluePeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $criteria = new Criteria(RoomHasFeaturevaluePeer::DATABASE_NAME);
     $criteria->add(RoomHasFeaturevaluePeer::ROOM_ID, $room_id);
     $criteria->add(RoomHasFeaturevaluePeer::FEATUREVALUE_ID, $featurevalue_id);
     $v = RoomHasFeaturevaluePeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }