public static function getHasRoomCriteria($roomId, $c = null) { if (is_null($c)) { $c = new Criteria(); } if (!is_null($roomId)) { $zones = ZonePeer::doSelectHasRoom($roomId, false); $zones_ids = array(); foreach ($zones as $zone) { $zones_ids[] = $zone->getId(); } $c->add(SubscriptionPeer::ZONE_ID, $zones_ids, Criteria::IN); } return $c; }