public function findNoticeVersionForProfile(EiProfil $kal_profil, EiFonction $ei_fonction, $lang)
 {
     if ($lang == null) {
         return null;
     }
     return $this->getInstance()->createQuery('vn')->Where('EiNoticeProfil.notice_id=vn.notice_id And EiNoticeProfil.notice_ref=vn.notice_ref And EiNoticeProfil.version_notice_id=vn.version_notice_id')->AndWhere('EiNotice.notice_id=EiNoticeProfil.notice_id And EiNotice.notice_ref=EiNoticeProfil.notice_ref')->AndWhere('KalFunction.function_id=EiNotice.function_id And KalFunction.function_ref=EiNotice.function_ref')->AndWhere('EiProfil.profile_id=EiNoticeProfil.profile_id And EiProfil.profile_ref=EiNoticeProfil.profile_ref')->andWhere('EiProfil.profile_id=? And EiProfil.profile_ref=? And vn.lang=?', array($kal_profil->getProfileId(), $kal_profil->getProfileRef(), $lang))->andWhere('KalFunction.function_id =? And KalFunction.function_ref=?', array($ei_fonction->getFunctionId(), $ei_fonction->getFunctionRef()))->execute();
 }