File: /var/www/dvpis2025/dvpis.kaunokolegija.lt/src/Repository/FiveYearLecturerPlanRepository.php
<?php
namespace App\Repository;
use App\Entity\FiveYearLecturerPlan;
use App\Entity\LecturerAgreement;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<FiveYearLecturerPlan>
*
* @method FiveYearLecturerPlan|null find($id, $lockMode = null, $lockVersion = null)
* @method FiveYearLecturerPlan|null findOneBy(array $criteria, array $orderBy = null)
* @method FiveYearLecturerPlan[] findAll()
* @method FiveYearLecturerPlan[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class FiveYearLecturerPlanRepository extends EntityRepository
{
public function findByIndex(LecturerAgreement $lecturerAgreement): array
{
$return = [];
$results = $this->findBy([
'lecturerAgreement' => $lecturerAgreement,
]);
foreach ($results as $result) {
$return[$result->getActivitiesGroupLecturerPositionActivity()->getId()] = $result;
}
return $return;
}
public function findFiveYearActivityPlans()
{
return $this->createQueryBuilder('f')
->join('f.lecturerAgreement', 'la')
->join('la.lecturer', 'l')
;
}
}