Skip to content

Commit a4385d8

Browse files
committed
Fix fetching of providers to use up less mysql bandwidth
1 parent e9540d0 commit a4385d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Entity/PackageRepository.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
*/
2727
class PackageRepository extends ServiceEntityRepository
2828
{
29+
private const LISTING_FIELDS = 'id, name, description, type, gitHubStars, frozen, language, abandoned, replacementPackage';
30+
private const LISTING_WITH_AUTO_UPDATE_WARNINGS_FIELDS = 'id, name, description, type, gitHubStars, frozen, language, abandoned, replacementPackage, autoUpdated, repository';
31+
2932
public function __construct(ManagerRegistry $registry)
3033
{
3134
parent::__construct($registry, Package::class);
@@ -37,7 +40,7 @@ public function __construct(ManagerRegistry $registry)
3740
public function findProviders(string $name): array
3841
{
3942
$query = $this->createQueryBuilder('p')
40-
->select('p')
43+
->select('partial p.{'.self::LISTING_FIELDS.'}')
4144
->leftJoin('p.versions', 'pv')
4245
->leftJoin('pv.provide', 'pr')
4346
->where('pv.development = true')

0 commit comments

Comments
 (0)