public function getStudentVocationByStudentId(Student $student)
 {
     $dql = "SELECT \n                    partial studentInGroups.{\n                        id,\n                        status\n                    },\n                    partial student.{\n                        id\n                    },\n                    partial studentGroup.{\n                        id\n                    },\n                    partial vocation.{\n                        id\n                    }\n                FROM Core\\Entity\\StudentInGroups studentInGroups\n                JOIN studentInGroups.student student\n                JOIN studentInGroups.studentGroup studentGroup\n                JOIN studentGroup.vocation vocation\n                WHERE studentInGroups.status=1 AND student.id=:studentId ";
     $q = $this->getEntityManager()->createQuery($dql);
     $q->setParameter('studentId', $student->getId(), Type::INTEGER);
     //$q->setHydrationMode(Query::HYDRATE_ARRAY);
     return $q->execute(null, Query::HYDRATE_OBJECT);
 }
Example #2
0
 /**
  * @covers Core\Entity\Student::setId
  * @covers Core\Entity\Student::getId
  */
 public function testSetGetId()
 {
     $this->student->setId(1);
     $this->assertEquals(1, $this->student->getId());
 }
 /**
  * {@inheritDoc}
  */
 public function getId()
 {
     if ($this->__isInitialized__ === false) {
         return parent::getId();
     }
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());
     return parent::getId();
 }