modify() 공개 메소드

modify config information
public modify ( ConfigEntity $config ) : ConfigEntity
$config ConfigEntity config entity instance
리턴 ConfigEntity
예제 #1
0
 /**
  * Set setting information
  *
  * @param array $data setting data
  * @return void
  */
 public function set(array $data)
 {
     $this->config = $this->cfg->set($this->key, $data);
     if (!$this->config->get('uuid')) {
         $this->config->set('uuid', $this->keygen->generate());
         $this->cfg->modify($this->config);
     }
 }
예제 #2
0
 public function testModifyThrowsExceptionWhenNotExists()
 {
     list($repo, $validator) = $this->getMocks();
     $mockConfig = m::mock('Xpressengine\\Config\\ConfigEntity');
     $mockConfig->siteKey = 'default';
     $mockConfig->name = 'board.notice';
     $repo->shouldReceive('find')->once()->with('default', 'board.notice')->andReturnNull();
     $instance = new ConfigManager($repo, $validator);
     try {
         $instance->modify($mockConfig);
         $this->assertTrue(false);
     } catch (\Exception $e) {
         $this->assertInstanceOf('Xpressengine\\Config\\Exceptions\\NotExistsException', $e);
     }
 }
예제 #3
0
 /**
  * Update menu item config consisting of theme identifiers
  *
  * @param MenuItem $item         menu item instance
  * @param string   $desktopTheme theme id
  * @param string   $mobileTheme  theme id
  * @return void
  */
 public function updateMenuItemTheme(MenuItem $item, $desktopTheme, $mobileTheme)
 {
     $configKeyString = $this->menuKeyString($item);
     $config = $this->configs->get($configKeyString);
     $config->set('desktopTheme', $desktopTheme);
     $config->set('mobileTheme', $mobileTheme);
     $this->configs->modify($config);
 }
예제 #4
0
 /**
  * putSiteConfig
  *
  * @param ConfigEntity $config site config entity
  *
  * @return void
  * @throws InvalidArgumentException
  */
 public function putSiteConfig(ConfigEntity $config)
 {
     $this->config->modify($config);
 }
예제 #5
0
 /**
  * 대상 instance 별 설정
  *
  * @param string $instanceId  instance identifier
  * @param array  $information config information
  * @return void
  * @throws NotConfiguredException
  */
 public function configure($instanceId, array $information)
 {
     $key = $this->getConfigKey($instanceId);
     if (!($config = $this->configs->get($key))) {
         throw new NotConfiguredException();
     }
     $information = array_merge($this->defaultConfig, $information);
     // division 설정은 최초 인스턴스 생성시 결정되며 변경할 수 없다.
     $information = array_diff_key($information, array_flip(['division']));
     foreach ($information as $name => $value) {
         $config->set($name, $value);
     }
     $this->configs->modify($config);
 }
예제 #6
0
 /**
  * updatePageConfig
  *
  * @param ConfigEntity $config page config entity
  *
  * @return void
  * @throws \Xpressengine\Config\Exceptions\InvalidArgumentException
  */
 public function updatePageConfig($config)
 {
     $this->configManager->modify($config);
 }