|
12345678910111213141516171819202122232425262728293031 |
- <?php
-
- namespace Lc\CaracoleBundle\Repository\Config;
-
- use Lc\SovBundle\Repository\AbstractStore;
-
- class UnitStore extends AbstractStore
- {
- protected UnitRepositoryQuery $query;
-
- public function __construct(UnitRepositoryQuery $query)
- {
- $this->query = $query;
- }
-
- public function getAsArray(){
- $query = $this->query->create();
-
- foreach ($query->find() as $unit) {
- $unitsList[$unit->getId()]['unit'] = $unit->getUnit();
- $unitsList[$unit->getId()]['wordingUnit'] = $unit->getWordingUnit();
- $unitsList[$unit->getId()]['wording'] = $unit->getWording();
- $unitsList[$unit->getId()]['wordingShort'] = $unit->getWordingShort();
- $unitsList[$unit->getId()]['coefficient'] = $unit->getCoefficient();
- $unitsList[$unit->getId()]['unitReference'] = $unit->getUnitReference()->getId();
- }
-
- return $unitsList;
-
- }
- }
|