You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 satır
932B

  1. <?php
  2. namespace Lc\CaracoleBundle\Repository\Config;
  3. use Lc\SovBundle\Repository\AbstractStore;
  4. class UnitStore extends AbstractStore
  5. {
  6. protected UnitRepositoryQuery $query;
  7. public function __construct(UnitRepositoryQuery $query)
  8. {
  9. $this->query = $query;
  10. }
  11. public function getAsArray(){
  12. $query = $this->query->create();
  13. foreach ($query->find() as $unit) {
  14. $unitsList[$unit->getId()]['unit'] = $unit->getUnit();
  15. $unitsList[$unit->getId()]['wordingUnit'] = $unit->getWordingUnit();
  16. $unitsList[$unit->getId()]['wording'] = $unit->getWording();
  17. $unitsList[$unit->getId()]['wordingShort'] = $unit->getWordingShort();
  18. $unitsList[$unit->getId()]['coefficient'] = $unit->getCoefficient();
  19. $unitsList[$unit->getId()]['unitReference'] = $unit->getUnitReference()->getId();
  20. }
  21. return $unitsList;
  22. }
  23. }