Simplified mapping of TagInfo objects

This commit is contained in:
Alejandro Celaya
2022-09-08 20:50:11 +02:00
parent 19a9d815eb
commit e6ee4ceae2
3 changed files with 7 additions and 1 deletions

View File

@@ -110,7 +110,7 @@ class TagRepository extends EntitySpecificationRepository implements TagReposito
return map(
$this->getEntityManager()->createNativeQuery($nativeQb->getSQL(), $rsm)->getResult(),
static fn (array $row) => new TagInfo($row['tag'], (int) $row['shortUrlsCount'], (int) $row['visitsCount']),
TagInfo::fromRawData(...),
);
}