Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $adminUser = $this->getAdminUser($manager);
     $organization = $this->getOrganization($manager);
     $emailTemplates = $this->getEmailTemplatesList($this->getEmailsDir());
     foreach ($emailTemplates as $fileName => $file) {
         $template = file_get_contents($file['path']);
         $emailTemplate = new EmailTemplate($fileName, $template, $file['format']);
         $emailTemplate->setOwner($adminUser);
         $emailTemplate->setOrganization($organization);
         $manager->persist($emailTemplate);
     }
     $manager->flush();
 }