/**
  * {@inheritDoc}
  */
 public function getPersonalCode()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPersonalCode', array());
     return parent::getPersonalCode();
 }
Beispiel #2
0
 /**
  * Creates lisUser and associates to given Teacher
  * 
  * @param \Core\Entity\Teacher $teacher
  * @param array|null $data
  * 
  * @return \Core\Entity\LisUser
  */
 protected function CreateTeacherUser(\Core\Entity\Teacher $teacher, $data = null)
 {
     $d = $data;
     if (!$d) {
         //if $data was not given
         $d = ['personalCode' => $teacher->getPersonalCode(), 'password' => uniqid(), 'email' => uniqid() . '@asd.ee'];
     }
     $lisUser = $this->em->getRepository('Core\\Entity\\LisUser')->Create($d);
     $teacher->setLisUser($lisUser);
     //associate
     $this->em->persist($teacher);
     $this->em->flush($teacher);
     return $lisUser;
 }
Beispiel #3
0
 /**
  * @covers Core\Entity\Teacher::setPersonalCode
  * @covers Core\Entity\Teacher::getPersonalCode
  */
 public function testSetGetPersonalCode()
 {
     $personalCode = "A011";
     $this->teacher->setPersonalCode($personalCode);
     $this->assertEquals($personalCode, $this->teacher->getPersonalCode());
 }