| Total Complexity | 6 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | final class CommodityRepository extends EntityRepository implements CommodityRepositoryInterface |
||
| 18 | { |
||
| 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 | } |
||
| 43 | |||
| 44 | public function getByType(int $typeId): array |
||
| 49 | } |
||
| 50 | |||
| 51 | public function getViewable(): array |
||
| 56 | } |
||
| 57 | |||
| 58 | public function getTradeable(): array |
||
| 65 | } |
||
| 66 | |||
| 67 | public function getTradeableNPC(): array |
||
| 73 | } |
||
| 74 | |||
| 75 | public function getAll(): array |
||
| 89 |