/** * Build and persist a box. * * @param string $hostname * @param PLN $network * @param ObjectManager $manager * * @return Box */ private function buildBox($hostname, $network, ObjectManager $manager) { $box = new Box(); $box->setHostName($hostname); $box->setPln($this->getReference($network)); $manager->persist($box); return $box; }