em = $em ; } public function getUnitsList() { $unitsList =array(); $units = $this->em->getRepository(UnitInterface::class)->findAll(); foreach ($units 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; } }