-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplay.php
32 lines (23 loc) · 802 Bytes
/
play.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
$loader = require_once __DIR__.'/app/bootstrap.php.cache';
Debug::enable();
require_once __DIR__.'/app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$kernel->boot();
$container = $kernel->getContainer();
$container->enterScope('request');
$container->set('request', $request);
//all the setup is done!
use Yoda\EventBundle\Entity\Event;
$event = new Event();
$event->setName('Dart\'s surprise birthday party!' );
$event->setLocation('Deatystar');
$event->setTime(new \DateTime('tomorrow noon'));
$event->setDetails('Ha! Darth HATES surprises!');
$em = $container->get('doctrine')->getManager();
$em->persist($event);
$em->flush();