示例#1
0
 public static function GetByAssoc($values)
 {
     $item = new PlaceHotspot();
     $item->ID = $values["hotspot_ID"];
     $item->Title = $values["hotspot_Title"];
     $item->Left = $values["hotspot_Left"];
     $item->Top = $values["hotspot_Top"];
     $item->Width = $values["hotspot_Width"];
     $item->Height = $values["hotspot_Height"];
     $item->TargetPlace = Place::GetByID($values["hotspot_TargetPlaceID"]);
     $item->TargetScript = $values["hotspot_TargetScript"];
     $item->TargetURL = $values["hotspot_TargetURL"];
     switch ($values["hotspot_TargetTypeID"]) {
         case 1:
             $item->TargetType = PlaceHotspotTargetType::URL;
             break;
         case 2:
             $item->TargetType = PlaceHotspotTargetType::Script;
             break;
         case 3:
             $item->TargetType = PlaceHotspotTargetType::Place;
             break;
         default:
             $item->TargetType = PlaceHotspotTargetType::Unknown;
             break;
     }
     return $item;
 }