| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function getByBuildingsOnColony(PlanetFieldHostInterface $host): array |
||
| 20 | { |
||
| 21 | return $this->getEntityManager() |
||
| 22 | ->createQuery( |
||
| 23 | sprintf( |
||
| 24 | 'SELECT c FROM %s c |
||
| 25 | WHERE c.id IN ( |
||
| 26 | SELECT bg.commodity_id |
||
| 27 | FROM %s bg |
||
| 28 | WHERE bg.buildings_id IN ( |
||
| 29 | SELECT pf.buildings_id |
||
| 30 | FROM %s pf |
||
| 31 | WHERE pf.%s = :hostId |
||
| 32 | ) |
||
| 33 | ) ORDER BY c.name ASC', |
||
| 34 | Commodity::class, |
||
| 35 | BuildingCommodity::class, |
||
| 36 | PlanetField::class, |
||
| 37 | $host->getPlanetFieldHostColumnIdentifier() |
||
| 38 | ) |
||
| 39 | ) |
||
| 40 | ->setParameter('hostId', $host->getId()) |
||
| 41 | ->getResult(); |
||
| 42 | } |
||
| 89 |