*/ final class AuditLogRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, AuditLog::class); } /** * @return list */ public function findEntityHistory(string $entityType, string $entityId, int $limit = 100): array { return $this->createQueryBuilder('a') ->andWhere('a.entityType = :entityType') ->andWhere('a.entityId = :entityId') ->setParameter('entityType', $entityType) ->setParameter('entityId', $entityId) ->orderBy('a.createdAt', 'DESC') ->setMaxResults($limit) ->getQuery() ->getResult(); } }