Ejemplo n.º 1
0
 public function load(ObjectManager $manager)
 {
     $cart = new Cart();
     $cart->setExpiresAt(new \DateTime('next day'));
     $cart->setIdentifier('1');
     $cart->setPrice(0);
     $cart->setFinalPrice(0);
     $ticket = new TicketItem();
     $ticket->setPrice(3);
     $ticket->setFinalPrice(3);
     $cart->addItem($ticket);
     $tShirt = new TshirtItem();
     $tShirt->setPrice(4);
     $tShirt->setFinalPrice(5);
     $cart->addItem($tShirt);
     $manager->persist($cart);
     $manager->flush();
     FixtureCollector::addCart(FixtureCollector::ORM, $cart);
 }