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; } }