예제 #1
0
 public function load(ObjectManager $manager)
 {
     $topersist = array();
     $cmdClient1 = $this->getReference("cmdClient1");
     $cmdClient1->setSoldeByAfterPaiement();
     //$cmdClient3 = $this->getReference("cmdClient3");
     // $manager->remove($cmdClient3);
     /* --- Creation de rendez vous ---*/
     array_push($topersist, $cmdClient1);
     $tableauClient = array(array("nom" => "Maris", "prenom" => "Colby", "telephone" => "0833 48 70 98", "portable" => "08 62 18 07 95"), array("nom" => "Anastasia", "prenom" => "Alyssa", "telephone" => "09 91 36 87 92", "portable" => "01 76 18 82 98"), array("nom" => "Dakota", "prenom" => "Vanna", "telephone" => "04 74 94 37 35", "portable" => "09 11 47 94 63"), array("nom" => "Mona", "prenom" => "Raya", "telephone" => "05 47 33 10 23", "portable" => "05 20 65 28 84"), array("nom" => "Hamish", "prenom" => "Kasimir", "telephone" => "09 60 80 19 94", "portable" => "05 06 19 93 28"), array("nom" => "Raymond", "prenom" => "Ulla", "telephone" => "01 15 02 13 83", "portable" => "06 89 35 75 10"), array("nom" => "Preston", "prenom" => "Natalie", "telephone" => "03 35 75 62 26", "portable" => "06 93 35 05 88"), array("nom" => "Vanna", "prenom" => "Sonya", "telephone" => "05 65 29 68 71", "portable" => "03 41 27 43 53"), array("nom" => "Hector", "prenom" => "Jackson", "telephone" => "02 46 69 39 28", "portable" => "05 59 72 10 96"), array("nom" => "Trevor", "prenom" => "Clio", "telephone" => "05 60 94 94 20", "portable" => "02 61 67 38 06"), array("nom" => "Alisa", "prenom" => "Mira", "telephone" => "04 56 89 50 69", "portable" => "09 31 23 32 15"), array("nom" => "Cecilia", "prenom" => "India", "telephone" => "07 08 49 57 34", "portable" => "08 48 19 15 00"), array("nom" => "Asher", "prenom" => "Ima", "telephone" => "01 51 65 37 08", "portable" => "05 61 98 83 91"), array("nom" => "Sasha", "prenom" => "Dana", "telephone" => "06 46 62 31 14", "portable" => "05 38 71 92 01"), array("nom" => "Jessamine", "prenom" => "Xander", "telephone" => "06 72 65 04 91", "portable" => "06 30 02 01 84"), array("nom" => "Shoshana", "prenom" => "Hunter", "telephone" => "08 03 61 80 68", "portable" => "02 52 25 42 56"), array("nom" => "Freya", "prenom" => "Zia", "telephone" => "06 68 91 62 52", "portable" => "08 68 06 06 76"), array("nom" => "Georgia", "prenom" => "Autumn", "telephone" => "02 71 05 25 44", "portable" => "04 50 90 19 70"), array("nom" => "Jana", "prenom" => "Avye", "telephone" => "09 58 37 52 82", "portable" => "04 80 07 45 56"), array("nom" => "Oren", "prenom" => "Gabriel", "telephone" => "04 70 74 45 78", "portable" => "05 96 77 51 98"), array("nom" => "Wing", "prenom" => "Dacey", "telephone" => "06 32 89 87 21", "portable" => "04 18 42 61 07"), array("nom" => "Kibo", "prenom" => "Vera", "telephone" => "02 37 05 53 65", "portable" => "02 58 23 00 52"), array("nom" => "Gretchen", "prenom" => "Nola", "telephone" => "02 82 28 81 07", "portable" => "02 77 75 80 81"), array("nom" => "Ian", "prenom" => "Erica", "telephone" => "03 83 88 45 04", "portable" => "09 68 95 54 72"), array("nom" => "Wyoming", "prenom" => "Dylan", "telephone" => "05 55 30 86 81", "portable" => "03 84 34 17 85"), array("nom" => "Dante", "prenom" => "Zachary", "telephone" => "06 72 13 37 56", "portable" => "06 70 55 36 05"), array("nom" => "Chantale", "prenom" => "Oleg", "telephone" => "07 61 60 65 26", "portable" => "02 14 41 05 28"), array("nom" => "Daphne", "prenom" => "Xaviera", "telephone" => "04 41 83 46 30", "portable" => "06 22 94 92 84"), array("nom" => "Maris", "prenom" => "Farrah", "telephone" => "05 13 42 36 26", "portable" => "06 02 42 37 41"));
     $tabObClient = array();
     foreach ($tableauClient as $ligneClient) {
         $ob = new Clients($ligneClient['nom']);
         $ob->setPrenom($ligneClient['prenom']);
         $ob->setTelephone(str_replace(" ", "", $ligneClient['telephone']));
         $ob->setPortable(str_replace(" ", "", $ligneClient['portable']));
         $ob->setMail($ligneClient['prenom'] . "@" . $ligneClient['nom'] . ".com");
         $dateN = rand(1942, 1989) . '-' . rand(1, 12) . '-' . rand(1, 27);
         $dateT = new \DateTime($dateN);
         $ob->setDateNaissance($dateT);
         $ob->setPointFidelite(rand(1, 12));
         $manager->persist($ob);
     }
     foreach ($topersist as $value) {
         $manager->persist($value);
     }
     $manager->flush();
 }
예제 #2
0
 public function load(ObjectManager $manager)
 {
     $topersist = array();
     $nat = array('nat', 'test', '*****@*****.**');
     $pat = array('sylvie', 'test', '*****@*****.**');
     $sal1 = $this->container->get('fos_user.util.user_manipulator')->create($nat[0], $nat[1], $nat[2], 1, 0);
     $sal1->setRoles(array('ROLE_ADMIN'));
     $sal2 = $this->container->get('fos_user.util.user_manipulator')->create($pat[0], $pat[1], $pat[2], 1, 0);
     $sal2->setRoles(array('ROLE_SALARIE'));
     $this->addReference($sal1->getUsername(), $sal1);
     $this->addReference($sal2->getUsername(), $sal2);
     array_push($topersist, $sal1, $sal2);
     //creation clients
     $client1 = new Clients("Lebowski");
     $client1->setPrenom("big")->setPortable("0785342312")->setTelephone("0243121212");
     $client2 = new Clients("Wolf");
     $client2->setPrenom("Dane")->setPortable("0556582273")->setTelephone("0731958913");
     $client3 = new Clients("BOB");
     $client3->setPrenom("Courtney")->setPortable("0886128101")->setTelephone("0461895261");
     $client4 = new Clients("Rivera");
     $client4->setPrenom("Ramona")->setPortable("0685093768")->setTelephone("0674328979");
     array_push($topersist, $client1, $client2, $client3, $client4);
     $this->addReference($client1->getNom(), $client1);
     $this->addReference($client2->getNom(), $client2);
     $this->addReference($client3->getNom(), $client3);
     $this->addReference($client4->getNom(), $client4);
     $Taxe20 = $this->getReference("Taxe20");
     $catHomme = $this->getReference("Homme");
     $catFemme = $this->getReference("Femme");
     $catEnfant = $this->getReference("Enfant et Ado");
     $catProd = $this->getReference("Produit");
     $listeArticleHomme = array(array('nom' => 'forf sh,cp,coif', 'tarif' => 13.33, 'designation' => 'shampoing, coupe, coiffage '), array('nom' => 'forf cp,coif', 'tarif' => 10.83, 'designation' => 'coupe, coiffage '), array('nom' => 'forf sh,cr,coif', 'tarif' => 10.83, 'designation' => 'shampoing, couronne, coiffage '), array('nom' => 'forf Sh,cp,coif,ras trad', 'tarif' => 25.0, 'designation' => 'shampoing, coupe, coiffage, rasage traditionel'), array('nom' => 'forf Sh,cp,coif,taille au ras', 'tarif' => 25.0, 'designation' => 'shampoing, coupe, coiffage, taille au rasoir'), array('nom' => 'forf Sh,cp,coif,ras design', 'tarif' => 29.17, 'designation' => 'shampoing, coupe, coiffage, rasage design'), array('nom' => 'cp, cr', 'tarif' => 7.5, 'designation' => 'coupe, couronne'), array('nom' => 'perm Hom', 'tarif' => 15.83, 'designation' => 'permanente pour homme'), array('nom' => 'couleur homme', 'tarif' => 17.5, 'designation' => 'couleur pour homme'), array('nom' => 'Ras trad', 'tarif' => 13.33, 'designation' => 'Rasage trad à l\'ancienne (cp choux)'), array('nom' => 'Ras des', 'tarif' => 17.5, 'designation' => 'Rasage design'), array('nom' => 'entret barbe', 'tarif' => 10.83, 'designation' => 'entretien tracer de barbe (-12 jours)'), array('nom' => 'taille br ras', 'tarif' => 12.5, 'designation' => 'taille barbe au rasoir'), array('nom' => 'taille br cis', 'tarif' => 5.83, 'designation' => 'taille barbe aux ciseaux'), array('nom' => 'taille br tond', 'tarif' => 4.17, 'designation' => 'taille barbe tondeuse'), array('nom' => 'taille moust', 'tarif' => 2.5, 'designation' => 'taille moustache'));
     $listeArticleFemme = array(array('nom' => 'forf sh,cp,brush ou m.e.p', 'tarif' => 19.17, 'designation' => 'shampoing, coupe, brushing ou mise en plis'), array('nom' => 'forf sh,brush ou m.e.p', 'tarif' => 12.5, 'designation' => 'shampoing, brushing ou mise en plis'), array('nom' => 'supp longueur', 'tarif' => 4.17, 'designation' => 'supplement longueur'), array('nom' => 'soin', 'tarif' => 4.17, 'designation' => 'soin'), array('nom' => 'mousse', 'tarif' => 4.17, 'designation' => 'mousse'), array('nom' => 'couleur à partir de', 'tarif' => 19.17, 'designation' => 'couleur'), array('nom' => 'permanente Fem', 'tarif' => 20.0, 'designation' => 'permanente Femme à partie de'), array('nom' => 'meches', 'tarif' => 21.67, 'designation' => 'mèches à partir de'), array('nom' => 'flash', 'tarif' => 12.5, 'designation' => 'flash'), array('nom' => 'decoloration', 'tarif' => 20.83, 'designation' => 'décoloration à partir de'), array('nom' => 'decapage', 'tarif' => 16.67, 'designation' => 'décapage à partir de'), array('nom' => 'chignon banane', 'tarif' => 23.33, 'designation' => 'chignon banane'), array('nom' => 'chignon +', 'tarif' => 27.5, 'designation' => 'chignon travaillé'), array('nom' => 'chignon ++', 'tarif' => 31.67, 'designation' => 'chignon travaillé ++'), array('nom' => 'forf mariage 2es', 'tarif' => 78.33, 'designation' => 'forfait mariage ( 2 essais + le jour j )'), array('nom' => 'forf mariage 1es', 'tarif' => 58.33, 'designation' => 'forfait mariage ( 1 essai + le jour j )'), array('nom' => 'tresse', 'tarif' => 14.17, 'designation' => 'tresse à partir de '));
     $listeArticleEnfant = array(array('nom' => 'sh,cp,coif -14', 'tarif' => 11.67, 'designation' => 'shampoing, coupe, coiffage -14 ans'), array('nom' => 'sh,cp,coif fille -18', 'tarif' => 15.0, 'designation' => 'shampoing, coupe, coiffage fille -18ans'), array('nom' => 'cp bb', 'tarif' => 7.5, 'designation' => 'coupe pour bébé'), array('nom' => 'cp enfant', 'tarif' => 10.0, 'designation' => 'coupe pour enfant'));
     foreach ($listeArticleEnfant as $value) {
         $ob = new Articles($value['nom'], $value['tarif'], $Taxe20, $catEnfant);
         $ob->setDesignation($value['designation']);
         array_push($topersist, $ob);
     }
     foreach ($listeArticleFemme as $value) {
         $ob = new Articles($value['nom'], $value['tarif'], $Taxe20, $catFemme);
         $ob->setDesignation($value['designation']);
         array_push($topersist, $ob);
     }
     foreach ($listeArticleHomme as $value) {
         $ob = new Articles($value['nom'], $value['tarif'], $Taxe20, $catHomme);
         $ob->setDesignation($value['designation']);
         array_push($topersist, $ob);
     }
     // create articles  $nom, $prixHt, $taxe, $categorie
     $art1 = new Articles("coupe homme classic", 19, $Taxe20, $catHomme);
     $art1->setDesignation("shampoing + coupe pour Homme");
     $art2 = new Articles("coupe femme classic", 24, $Taxe20, $catHomme);
     $art2->setDesignation("shampoing + coupe pour Femme");
     $art3 = new Articles("coupe enfant classic", 12, $Taxe20, $catHomme);
     $art3->setDesignation("shampoing + coupe pour Enfant");
     $art4 = new Articles("shampoing femme", 14, $Taxe20, $catFemme);
     $art4->setDesignation("shampoing pour Femme");
     $art5 = new Articles("diver", null, $Taxe20, $catProd);
     $art5->setDesignation("divers-test");
     $art5->setEditable(true);
     $art6 = new Articles("Couleur", 38, $Taxe20, $catFemme);
     $art6->setDesignation("Couleur test");
     $art6->setTechnique(true);
     array_push($topersist, $art1, $art2, $art3, $art4, $art5, $art6);
     $this->addReference($art1->getNom(), $art1);
     $this->addReference($art2->getNom(), $art2);
     $this->addReference($art3->getNom(), $art3);
     $this->addReference($art4->getNom(), $art4);
     $this->addReference($art5->getNom(), $art5);
     $this->addReference($art6->getNom(), $art6);
     foreach ($topersist as $value) {
         $manager->persist($value);
     }
     $manager->flush();
 }
예제 #3
0
 public function configTest()
 {
     $client = new Clients();
     $client->setNom($this->chaineTest);
     return $client;
 }