Esempio n. 1
0
 public function load(ObjectManager $manager)
 {
     $names = array('Chiara', 'Maria', 'Giancarlo', 'Emanuele', 'Andrea', 'Irene', 'Fabio', 'Luigi', 'Francesco', 'Paolo');
     $last_names = array('Petrioli', 'De Marsico', 'Bongiovanni', 'Panizzi', 'Sterbini', 'Finocchi', 'Pellacini', 'Cinque', 'Presicce', 'Bottoni');
     $emails = array('*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**');
     $passwords = array('petrioli', 'demarsico', 'bongiovanni', 'panizzi', 'sterbini', 'finocchi', 'pellacini', 'cinque', 'presicce', 'bottoni');
     $role = 1;
     for ($i = 0; $i < 10; $i++) {
         $teacher = new Teacher();
         $teacher->setName($names[$i]);
         $teacher->setLastName($last_names[$i]);
         $teacher->setEmail($emails[$i]);
         $teacher->setPassword($passwords[$i]);
         //codificare
         $teacher->setSubscriptionDate(new \DateTime());
         $teacher->setRole($role);
         $manager->persist($teacher);
         $manager->flush();
     }
 }
 /**
  * {@inheritDoc}
  */
 public function setEmail($email)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setEmail', array($email));
     return parent::setEmail($email);
 }