public function getSimilar(int $specializationId, int $currentId)
{
$v = $this
->createQueryBuilder('v')
->where('specialization_id = : specializationId')
->andWhere('id <> ' . $currentId)
->setParameters([
'specializationId' => $specializationId,
'id' => $currentId,
])
->orderBy('expirationDate DESC', 'bonus DESC')
->setMaxResults(2)
->getQuery()
->getResult();
}
$SomeEntytyREpo->getSimilar($Entity->getId(), $Entity->getOneMoreFieldValue)