請任何人能解釋這些Doctrine
指令上Symfony2
框架你能給我一些澄清學說
1. $academicYear = $em->getRepository('ComAkSolutionsSmsUserBundle:AcademicYear')
->find($id);
2. public function manageAcademicClassAction($classId, Request $request)
{
$em = $this->getDoctrine()->getManager();
$academicClass = $em->getRepository('ComAkSolutionsSmsUserBundle:AcademicClass')
->find($classId);
$academicYear = $em->getRepository('ComAkSolutionsSmsUserBundle:AcademicYear')
->find($academicClass->getAcademicYearId());
3. $students = $em->getRepository('ComAkSolutionsSmsUserBundle:StudentProfile')
->findBySectionId($sectionId);
4. $teacherProfile = $em->getRepository('ComAkSolutionsSmsUserBundle:TeacherProfile')
->findOneByUser($user);
我guessog第一個查詢應該是$ academicClass = ... – Cerad
嗨,我在這樣 – Jecintha
公共職能manageAcademicClassAction這個功能我使用($ CLASSID,請求$請求) { $ EM = $此 - > getDoctrine() - > getManager(); // $ CLASSID是AcademicClassId //獲取AcademicClass $ academicClass = $ EM-> getRepository( 'ComAkSolutionsSmsUserBundle:AcademicClass') - >找到($的classid); $ academicYear = $ em-> getRepository('ComAkSolutionsSmsUserBundle:AcademicYear') - > find($ academicClass-> getAcademicYearId());} – Jecintha