Exemplo n.º 1
0
 private function appendSystem(GalaxyEntity $galaxyEntity)
 {
     $systemEntity = new SystemEntity();
     $systemEntity->setGalaxy($galaxyEntity);
     $systemEntity->setNumber($galaxyEntity->countSystems());
     $this->em->persist($systemEntity);
     $celestialBodyCount = rand($this->universeEntity->getMinCelestialBodies(), $this->universeEntity->getMaxCelestialBodies() - 1);
     for ($i = 0; $i < $celestialBodyCount; ++$i) {
         $this->appendCelestialBody($systemEntity);
     }
 }