示例#1
0
 public function update(PageCategory $pageCategory)
 {
     $this->setName($pageCategory->getName());
 }
示例#2
0
 /**
  * Initalises the default settings used for this application
  *
  * @param $websiteName string The name of the website
  * @param $websiteEmail string The email of the website
  * @param $websiteReplyToEmail string The email to which users may reply
  * @param $websiteUrl string The url of the website
  */
 public function initDatabaseSettings($websiteName, $websiteEmail, $websiteReplyToEmail, $websiteUrl)
 {
     $websiteNameSetting = new Setting();
     $websiteNameSetting->setName('website_name');
     $websiteNameSetting->setValue($websiteName);
     $websiteEmailSetting = new Setting();
     $websiteEmailSetting->setName('website_email');
     $websiteEmailSetting->setValue($websiteEmail);
     $websiteReplyToEmailSetting = new Setting();
     $websiteReplyToEmailSetting->setName('website_reply_to_email');
     $websiteReplyToEmailSetting->setValue($websiteReplyToEmail);
     $websiteUrlSetting = new Setting();
     $websiteUrlSetting->setName('website_url');
     $websiteUrlSetting->setValue($websiteUrl);
     $debugMode = new Setting();
     $debugMode->setName('debug_mode');
     $debugMode->setValue(false);
     $defaultArticleCategory = new ArticleCategory();
     $defaultArticleCategory->setName('Default');
     $defaultPageCategory = new PageCategory();
     $defaultPageCategory->setName('Default');
     $defaultUserGroup = new UserGroup();
     $defaultUserGroup->setName('User');
     $defaultUserGroup->setRole('ROLE_USER');
     $adminUserGroup = new UserGroup();
     $adminUserGroup->setName('Admin');
     $adminUserGroup->setRole('ROLE_SUPER_ADMIN');
     $language = new Language();
     $language->setCode('en');
     $language->setName('English');
     $this->entityManager->persist($websiteNameSetting);
     $this->entityManager->persist($websiteEmailSetting);
     $this->entityManager->persist($websiteReplyToEmailSetting);
     $this->entityManager->persist($websiteUrlSetting);
     $this->entityManager->persist($debugMode);
     $this->entityManager->persist($defaultArticleCategory);
     $this->entityManager->persist($defaultPageCategory);
     $this->entityManager->persist($defaultUserGroup);
     $this->entityManager->persist($adminUserGroup);
     $this->entityManager->persist($language);
     $this->entityManager->flush();
 }