@@ -484,11 +484,11 @@ public static function GetUpcoming()
484484 {
485485 $ now = new \DateTime ('now ' , new DateTimeZone ('UTC ' ));
486486
487- return Summit::get ()->filter (array (
487+ return Summit::get ()->filter ([
488488 'SummitBeginDate:GreaterThanOrEqual ' => $ now ->format ('Y-m-d H:i:s ' ),
489489 'SummitEndDate:GreaterThanOrEqual ' => $ now ->format ('Y-m-d H:i:s ' ),
490490 'Active ' => 1
491- ) )->first ();
491+ ] )->first ();
492492 }
493493
494494 private $ must_seed = false ;
@@ -1056,133 +1056,14 @@ public function findTicketTypeByExternalId($ticket_external_id)
10561056 */
10571057 public static function seedBasicEventTypes ($ summit_id )
10581058 {
1059- $ presentation = SummitEventType::get ()->filter (['Type ' => IPresentationType::Presentation, 'SummitID ' => $ summit_id ])->first ();
1060- if (is_null ($ presentation )) {
1061- $ presentation = new PresentationType ();
1062- }
1063-
1064- $ presentation ->Type = IPresentationType::Presentation;
1065- $ presentation ->SummitID = $ summit_id ;
1066- $ presentation ->MinSpeakers = 1 ;
1067- $ presentation ->MaxSpeakers = 3 ;
1068- $ presentation ->MinModerators = 0 ;
1069- $ presentation ->MaxModerators = 0 ;
1070- $ presentation ->UseSpeakers = true ;
1071- $ presentation ->ShouldBeAvailableOnCFP = true ;
1072- $ presentation ->AreSpeakersMandatory = false ;
1073- $ presentation ->UseModerator = false ;
1074- $ presentation ->IsModeratorMandatory = false ;
1075- $ presentation ->IsDefault = true ;
1076- $ presentation ->write ();
1077-
1078- $ key_note = SummitEventType::get ()->filter (['Type ' => IPresentationType::Keynotes, 'SummitID ' => $ summit_id ])->first ();
1079- if (is_null ($ key_note )) {
1080- $ key_note = new PresentationType ();
1059+ foreach (DefaultSummitEventType::get () as $ default_event_type ){
1060+ if (SummitEventType::get ()->filter ([
1061+ 'Type ' => $ default_event_type ->Type ,
1062+ 'SummitID ' => $ summit_id
1063+ ])->count () > 0 ) continue ;
1064+ $ event_type = $ default_event_type ->buildEventType ($ summit_id );
1065+ $ event_type ->write ();
10811066 }
1082-
1083- $ key_note ->Type = IPresentationType::Keynotes;
1084- $ key_note ->SummitID = $ summit_id ;
1085- $ key_note ->MinSpeakers = 1 ;
1086- $ key_note ->MaxSpeakers = 3 ;
1087- $ key_note ->MinModerators = 0 ;
1088- $ key_note ->MaxModerators = 1 ;
1089- $ key_note ->ShouldBeAvailableOnCFP = false ;
1090- $ key_note ->UseSpeakers = true ;
1091- $ key_note ->AreSpeakersMandatory = false ;
1092- $ key_note ->UseModerator = true ;
1093- $ key_note ->IsModeratorMandatory = false ;
1094- $ key_note ->IsDefault = true ;
1095- $ key_note ->write ();
1096-
1097- $ panel = SummitEventType::get ()->filter (['Type ' => IPresentationType::Panel, 'SummitID ' => $ summit_id ])->first ();
1098- if (is_null ($ panel )) {
1099- $ panel = new PresentationType ();
1100- }
1101-
1102- $ panel ->Type = IPresentationType::Panel;
1103- $ panel ->SummitID = $ summit_id ;
1104- $ panel ->MinSpeakers = 1 ;
1105- $ panel ->MaxSpeakers = 3 ;
1106- $ panel ->MinModerators = 0 ;
1107- $ panel ->MaxModerators = 1 ;
1108- $ panel ->ShouldBeAvailableOnCFP = true ;
1109- $ panel ->UseSpeakers = true ;
1110- $ panel ->AreSpeakersMandatory = false ;
1111- $ panel ->UseModerator = true ;
1112- $ panel ->IsModeratorMandatory = false ;
1113- $ panel ->IsDefault = true ;
1114- $ panel ->write ();
1115-
1116- $ lighting_talks = SummitEventType::get ()->filter (['Type ' => IPresentationType::LightingTalks, 'SummitID ' => $ summit_id ])->first ();
1117- if (is_null ($ lighting_talks )) {
1118- $ lighting_talks = new PresentationType ();
1119- }
1120-
1121- $ lighting_talks ->Type = IPresentationType::LightingTalks;
1122- $ lighting_talks ->SummitID = $ summit_id ;
1123- $ lighting_talks ->MinSpeakers = 1 ;
1124- $ lighting_talks ->MaxSpeakers = 3 ;
1125- $ lighting_talks ->MinModerators = 0 ;
1126- $ lighting_talks ->MaxModerators = 0 ;
1127- $ lighting_talks ->UseSpeakers = true ;
1128- $ lighting_talks ->ShouldBeAvailableOnCFP = true ;
1129- $ lighting_talks ->AreSpeakersMandatory = false ;
1130- $ lighting_talks ->UseModerator = false ;
1131- $ lighting_talks ->IsModeratorMandatory = false ;
1132- $ lighting_talks ->IsDefault = true ;
1133- $ lighting_talks ->write ();
1134-
1135- $ hand_on_labs = SummitEventType::get ()->filter (['Type ' => ISummitEventType::HandonLabs, 'SummitID ' => $ summit_id ])->first ();
1136- if (is_null ($ hand_on_labs )) {
1137- $ hand_on_labs = new SummitEventType ();
1138-
1139- }
1140-
1141- $ hand_on_labs ->Type = ISummitEventType::HandonLabs;
1142- $ hand_on_labs ->SummitID = $ summit_id ;
1143- $ hand_on_labs ->IsDefault = true ;
1144- $ hand_on_labs ->write ();
1145-
1146- $ lunch = SummitEventType::get ()->filter (['Type ' => ISummitEventType::Lunch, 'SummitID ' => $ summit_id ])->first ();
1147- if (is_null ($ lunch )) {
1148- $ lunch = new SummitEventType ();
1149- }
1150-
1151- $ lunch ->Type = ISummitEventType::Lunch;
1152- $ lunch ->SummitID = $ summit_id ;
1153- $ lunch ->IsDefault = true ;
1154- $ lunch ->write ();
1155-
1156- $ breaks = SummitEventType::get ()->filter (['Type ' => ISummitEventType::Breaks, 'SummitID ' => $ summit_id ])->first ();
1157- if (is_null ($ breaks )) {
1158- $ breaks = new SummitEventType ();
1159- }
1160-
1161- $ breaks ->Type = ISummitEventType::Breaks;
1162- $ breaks ->SummitID = $ summit_id ;
1163- $ breaks ->IsDefault = true ;
1164- $ breaks ->write ();
1165-
1166- $ evening_events = SummitEventType::get ()->filter (['Type ' => ISummitEventType::EveningEvents, 'SummitID ' => $ summit_id ])->first ();
1167- if (is_null ($ evening_events )) {
1168- $ evening_events = new SummitEventType ();
1169- }
1170-
1171- $ evening_events ->Type = ISummitEventType::EveningEvents;
1172- $ evening_events ->SummitID = $ summit_id ;
1173- $ breaks ->IsDefault = true ;
1174- $ evening_events ->write ();
1175-
1176-
1177- $ groups_events = SummitEventType::get ()->filter (['Type ' => ISummitEventType::GroupsEvents, 'SummitID ' => $ summit_id ])->first ();
1178- if (is_null ($ groups_events )) {
1179- $ groups_events = new SummitEventType ();
1180- }
1181-
1182- $ groups_events ->Type = ISummitEventType::GroupsEvents;
1183- $ groups_events ->SummitID = $ summit_id ;
1184- $ groups_events ->IsDefault = true ;
1185- $ groups_events ->write ();
11861067 }
11871068
11881069 /**
0 commit comments