/**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $event1 = new Event();
     $event1->setName('Darth\'s surprise birthday party!');
     $event1->setLocation('Deathstar');
     $event1->setTime(new \DateTime('tomorrow noon'));
     $event1->setDetails('Darth HATES surprises!!');
     $manager->persist($event1);
     $event2 = new Event();
     $event2->setName('Rebellion Fundraiser Bake Sale!');
     $event2->setLocation('Endor');
     $event2->setTime(new \DateTime('Thursday noon'));
     $event2->setDetails('Ewok pies! Support the rebellion!');
     $manager->persist($event2);
     $manager->flush();
 }
 public function load(ObjectManager $manager)
 {
     $event1 = new Event();
     $event1->setName('Darth\'s Birthday Party!');
     $event1->setLocation('Deathstar');
     $event1->setTime(new \DateTime('tomorrow noon'));
     $event1->setDetails('Ha! Darth HATES surprises!!!');
     $manager->persist($event1);
     $event3 = new Event();
     $event3->setName('Asia 2015 Symfony conference');
     $event3->setLocation('Beijing');
     $event3->setTime(new \DateTime('Thursday noon'));
     $event3->setDetails('Everybody who want to talk about symfony 2 framework');
     $manager->persist($event3);
     // the queries aren't done until now
     $manager->flush();
 }
Exemple #3
0
 public function load(ObjectManager $manager)
 {
     $event1 = new Event();
     $event1->setName('My first event');
     $event1->setLocation('Waddesdon');
     //$event1->setTime(new \DateTime('tomorrownoon'));
     $event1->setTime(new \DateTime('tomorrow noon'));
     $event1->setDetails('He will love this!');
     $manager->persist($event1);
     $event2 = new Event();
     $event2->setName('My Second event');
     $event2->setLocation('Quatin');
     // $event2->setTime(new \DateTime('tomorrowlunchtime'));
     $event2->setTime(new \DateTime('tomorrow noon'));
     $event2->setDetails('He will hate this!');
     $manager->persist($event2);
     $manager->flush();
 }
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $wayne = $manager->getRepository('UserBundle:User')->findOneByUsernameOrEmail('wayne');
     $event1 = new Event();
     $event1->setName('some event name');
     $event1->setLocation('some location');
     $event1->setTime(new \DateTime('tomorrow noon'));
     $event1->setDetails('some details to the event');
     $manager->persist($event1);
     $event2 = new Event();
     $event2->setName('event 2');
     $event2->setLocation('location 2');
     $event2->setTime(new \DateTime('Thursday noon'));
     $event2->setDetails('some details to the event');
     $manager->persist($event2);
     $event1->setOwner($wayne);
     $event2->setOwner($wayne);
     $manager->flush();
 }
Exemple #5
0
 public function load(ObjectManager $manager)
 {
     $wayne = $manager->getRepository('UserBundle:User')->findOneByUsernameOrEmail('wayne');
     $event1 = new Event();
     $event1->setName('Darth\'s Birthday Party!');
     $event1->setLocation('Deathstar');
     $event1->setTime(new \DateTime('tomorrow noon'));
     $event1->setDetails('Ha! Darth HATES surprises!');
     $manager->persist($event1);
     $event2 = new Event();
     $event2->setName('Rebellion Fundraiser Bake Sale!');
     $event2->setLocation('Endor');
     $event2->setTime(new \DateTime('Thursday noon'));
     $event2->setDetails('Ewok pies! Support the rebellion!');
     $manager->persist($event2);
     $event1->setOwner($wayne);
     $event2->setOwner($wayne);
     $manager->flush();
 }
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $user = $this->getReference('user-user');
     $event1 = new Event();
     $event1->setName('Darth\'s Birthday Party!');
     $event1->setLocation('Deathstar');
     $event1->setTime(new \DateTime('yesterday noon'));
     $event1->setDetails('Ha! Darth HATES surprises!!!');
     $event1->setOwner($user);
     $manager->persist($event1);
     $event2 = new Event();
     $event2->setName('Rebellion Fundraiser Bake Sale!');
     $event2->setLocation('Endor');
     $event2->setTime(new \DateTime('Thursday noon'));
     $event2->setDetails('Ewok pies! Support the rebellion!');
     $event2->setOwner($user);
     $manager->persist($event2);
     // the queries aren't done until now
     $manager->flush();
 }
Exemple #7
0
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);
//$templating = $container->get('templating');
//
//echo $templating->render(
//    'EventBundle:Default:index.html.twig',
//    array(
//        'name'=>'Vader',
//        'count'=>3
//    )
//);
use Yoda\EventBundle\Entity\Event;
$event = new Event();
$event->setName('Darth\'s surprise birthday party!');
$event->setLocation('Dearth Star');
$event->setTime(new \DateTime('tomorrow noon'));
$event->setDetails('Ha he will hate this');
$em = $container->get('doctrine')->getManager();
$em->persist($event);
$em->flush();
Exemple #8
0
<?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;
/**
 * @var Composer\Autoload\ClassLoader $loader
 */
$loader = (require __DIR__ . '/app/autoload.php');
Debug::enable();
$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 !! Woo hoo!
//$templating=$container->get('templating');
//echo $templating->render(
//        'MyCompanyTestBundle:Default:index.html.twig',
//        array('name'=> 'Vader', 'count'=>3)
//        );
use Yoda\EventBundle\Entity\Event;
$event = new Event();
$event->setName('Darth\'s surprise birthday party!');
$event->setLocation('Deathstar');
$event->setTime(new \DateTime('tomorrow noon'));
$event->setDetails('Ha! Darth HATES surprises!!!');
$em = $container->get('doctrine')->getManager();
$em->persist($event);
$em->flush();