/**
  * {@inheritDoc}
  */
 public function setLisUser($lisUser)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setLisUser', array($lisUser));
     return parent::setLisUser($lisUser);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 3
0
 /**
  * @covers Core\Entity\Teacher::setLisUser
  * @covers Core\Entity\Teacher::getLisUser
  */
 public function testSetGetLisUser()
 {
     $lisUser = $this->getMockBuilder('Core\\Entity\\LisUser')->getMock();
     $this->teacher->setLisUser($lisUser);
     $this->assertEquals($lisUser, $this->teacher->getLisUser());
 }