Exemplo n.º 1
0
 public static function import()
 {
     $event = Event::get_from_id($_SESSION["event_id"]);
     $file = Form::get_file("guest_filename");
     $guest_array = file($file, FILE_IGNORE_NEW_LINES);
     debug('guest_array: ' . sprint_r($guest_array));
     foreach ($guest_array as $line) {
         if (!Guest::valid_line($line)) {
             continue;
         }
         $guest = new Guest();
         $guest->hydrate();
         $guest->set_value("email", $line);
         $guest->store();
         $guest->link_to_event($event->id);
     }
 }