Ejemplo n.º 1
0
 /**
  * Load data fixtures with the passed EntityManager
  * @author Eric
  *
  * @param ObjectManager $manager
  */
 public function load(ObjectManager $manager)
 {
     $brands = [0 => ['title' => 'Bachmann', 'description' => 'HO, N, O, G, Ho3, '], 1 => ['title' => 'Intermountain', 'description' => 'Spécialiste de la EMD série F'], 2 => ['title' => 'Lessieur', 'description' => 'La meilleur']];
     foreach ($brands as $key => $brand) {
         $marque = new Marque();
         $marque->setTitle($brand['title']);
         $marque->setDescription($brand['description']);
         $manager->persist($marque);
         $manager->flush();
         $this->addReference('brand' . $key, $marque);
     }
 }
Ejemplo n.º 2
0
 /**
  * Add marque
  *
  * @param \Troiswa\BackBundle\Entity\Marque $marque
  *
  * @return Tags
  */
 public function addMarque(\Troiswa\BackBundle\Entity\Marque $marque)
 {
     $this->marques[] = $marque;
     $marque->addTag($this);
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * @ParamConverter("marque", class="TroiswaBackBundle:Marque", options={"mapping": {"id" = "slug"}})
  */
 public function showAction(Marque $marque)
 {
     /*
       $breadcrumbs = $this->get("white_october_breadcrumbs");
       $breadcrumbs->addItem("Dashboard", $this->generateUrl("troiswa_back_page_bo"));
       $breadcrumbs->addItem("Marque", $this->generateUrl("troiswa_back_marque"));
       $breadcrumbs->addItem($marque->getTitle());
     */
     $this->breadcrumbs(['Marque' => $this->generateUrl("marque"), $marque->getTitre() => '']);
     $deleteForm = $this->createDeleteForm($marque->getId());
     return $this->render('TroiswaBackBundle:Marque:show.html.twig', array('entity' => $marque, 'delete_form' => $deleteForm->createView()));
 }