コード例 #1
0
 public static function LoadByCountry($strCountry, $blnRestrict = false)
 {
     $objCountry = Country::LoadByCode($strCountry);
     if ($blnRestrict) {
         if (count(Destination::model()->countByAttributes(array('country' => $objCountry->id, 'state' => null)))) {
             $arrStates = State::model()->findAllByAttributes(array('country_id' => $objCountry->id, 'active' => 1), State::GetDefaultOrdering());
             return Destination::ConvertStatesToDestinations($objCountry->id, $arrStates);
         }
     }
     return Destination::model()->findAll('country IS NULL OR country=:t1 ' . Destination::GetDefaultOrdering(true), array(':t1' => $objCountry->id));
 }