<commit_before><?php

class DatabaseSeeder extends Seeder
{

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Eloquent::unguard();

        $school = new School();
        $school->name = "open Summer of code 2015";
        $school->city = "Gent";

        $school->save();

        $user = Sentry::createUser(
            [
                'email' => "<EMAIL>",
                'password' => "password",
                'activated' => true,
                'school_id' => $school->id,
                'first_name' => "John",
                'last_name' => "Doe",
            ]
        );

        // make sure the roles exist
        UserController::checkCreateRoles();
        // Find the role using the calendar id

        $adminRole = Sentry::findGroupByName('admin');

        // Assign the calendar to the user
        $user->addGroup($adminRole);

        $user2 = Sentry::createUser(
            [
                'email' => "<EMAIL>",
                'password' => "password",
                'activated' => true,
                'school_id' => $school->id,
                'first_name' => "Foo",
                'last_name' => "Bar",
            ]
        );

        $editorRole = Sentry::findGroupByName('editor');

        // Assign the calendar to the user
        $user2->addGroup($editorRole);

        $calendar = new Calendar();
        $calendar->name = "global";
        $calendar->description = "events for everyone";
        $calendar->school_id = $school->id;

        $calendar->save();

        $app = new Appointment();

        $app->title = "test event";
        $app->description = "we're going to test something";
        $app->location = "Gent";
        $app->calendar_id = $calendar->id;
        $app->start_date = new DateTime("14-07-2015" . ' ' . "10:00");
        $app->end_date = new DateTime("14-07-2015" . ' ' . "22:00");
        $app->save();

        // link to global calendar
        $user->calendars()->attach($calendar);

    }
}<commit_msg>Update seeder to create more events<commit_after><?php

class DatabaseSeeder extends Seeder
{

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        Eloquent::unguard();

        $school = new School();
        $school->name = "open Summer of code 2015";
        $school->city = "Gent";

        $school->save();

        // make sure the roles exist
        UserController::checkCreateRoles();
        // Find the role using the calendar id

        $adminRole = Sentry::findGroupByName('admin');


        $user2 = Sentry::createUser(
            [
                'email' => "<EMAIL>",
                'password' => "password",
                'activated' => true,
                'school_id' => $school->id,
                'first_name' => "Foo",
                'last_name' => "Bar",
            ]
        );

        $editorRole = Sentry::findGroupByName('editor');

        // Assign the calendar to the user
        $user2->addGroup($editorRole);

        $calendar = new Calendar();
        $calendar->name = "global";
        $calendar->description = "events for everyone";
        $calendar->school_id = $school->id;

        $calendar->save();

        for ($i=0; $i < 200; $i++) {
            $app = new Appointment();

            $app->title ="School event " . $i;
            $app->description = "we're going to test " . rand() . " something";
            $app->location = "Gent";
            $app->calendar_id = $calendar->id;
            $date = date('Y-m-d', strtotime( '+'.mt_rand(-30,90).' days'));
            $app->start_date = new DateTime($date . ' 13:00');
            $app->end_date = new DateTime($date . ' 16:00');
            $app->save();
        }

        // link to global calendar
        $user2->calendars()->attach($calendar);

    }
}
{'fraction_non_alphanumeric': 0.1588977594643317, 'fraction_numerical': 0.013649240278135463, 'mean_word_length': 1.6493860845839017, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 66, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4902461', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1088, 'n_words': 252}