em = $entityManager; } public function getEntity($entity, $id) { $repo = $this->em->getRepository(ProductCategoryInterface::class); $data = $repo->findBy(array()); dump($data); if($entity == 'product'){ $repo = $this->em->getRepository(ProductInterface::class); $data = $repo->find($id); $data= array( 'id' => $data->getId(), 'title' => $data->getTitleInherited(), 'price' => $data->getPriceInherited(), 'unit' => $data->getUnitInherited(), 'availableQuantity' => $data->getAvailableQuantityInherited(), 'taxRate' => $data->getTaxRateInherited(), ); } return new Response('NICHE'); } }