/** * @return int */ public function loadPublisherTheme() { $entity = new PublisherTheme(); $entity->setPublisher($this->em->getRepository(Publisher::class)->find(1))->setTitle('Sample Publisher Theme')->setPublic(true)->setCss('.sample-css{}'); $this->em->persist($entity); $this->em->flush(); return $entity->getId(); }