public function loadIndex() { $entity = new Index(); $entity->setName('Sample index')->setStatus(true); $this->em->persist($entity); $this->em->flush(); return $entity->getId(); }