set() public method

set entity value
public set ( string $name, mixed $value ) : void
$name string variable name
$value mixed variable value
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);
     }
 }
 public function index()
 {
     /** @var \Xpressengine\Config\ConfigManager $configManager */
     $configManager = app('xe.config');
     $config = $configManager->get('openseminar');
     if ($config === null) {
         $config = new ConfigEntity();
         $config->set('document_point', 2);
         $config->set('comment_point', 1);
         $configManager->add('openseminar', $config->getPureAll());
     }
     return XePresenter::make('openseminar_1212::views.manager.index', ['config' => $config]);
 }
 /**
  * DynamicField 생성
  * * ConfigManager 를 이용해 설정 정보를 저장
  * * FieldTypeManager 로 Dynamic Field Table 생성
  *
  * @param ConfigEntity $config insert config entity
  * @param ColumnEntity $column join column entity
  * @return void
  */
 public function create(ConfigEntity $config, ColumnEntity $column = null)
 {
     $group = $config->get('group');
     $id = $config->get('id');
     if ($group == null || $id == null) {
         throw new Exceptions\InvalidConfigException();
     }
     if ($this->configHandler->get($group, $id) !== null) {
         throw new Exceptions\AlreadyExistException();
     }
     if ($this->configHandler->parent($group) == null) {
         $this->configHandler->setParent($group);
     }
     if ($column === null) {
         $column = $this->getDefaultJoinColumn();
     }
     $config->set('joinColumnName', $column->name);
     $this->connection->beginTransaction();
     $this->configHandler->add($config);
     $type = $this->registerHandler->getType($this, $config->get('typeId'));
     $type->setConfig($config);
     $type->create($column);
     $this->connection->commit();
 }
 /**
  * 새로운 document config entity 를 만들어 반환
  *
  * @param string $instanceId instance id
  * @param array  $params     parameters
  * @return ConfigEntity
  */
 public function make($instanceId, array $params)
 {
     $config = ['instanceId' => $instanceId, 'group' => 'documents_' . $instanceId];
     $config = array_merge($config, $params);
     foreach ($this->getDefault() as $name => $value) {
         if (isset($params[$name]) === true) {
             $value = $params[$name];
         }
         $config[$name] = $value;
     }
     $configEntity = new ConfigEntity();
     foreach ($config as $name => $value) {
         $configEntity->set($name, $value);
     }
     return $configEntity;
 }
Esempio n. 5
0
 /**
  * binding registered closure to config
  *
  * @param ConfigEntity $config config instance
  * @return void
  */
 protected function bindClosure(ConfigEntity &$config)
 {
     if (isset($this->closures[$config->siteKey]) && isset($this->closures[$config->siteKey][$config->name])) {
         $closures = $this->closures[$config->siteKey][$config->name];
         foreach ($closures as $item => $closure) {
             $config->set($item, $closure);
         }
     }
 }
Esempio n. 6
0
 /**
  * createDocumentInstance
  *
  * @param string $pageId    page instance id
  * @param string $pageTitle page title
  *
  * @return void
  */
 protected function createDocumentInstance($pageId, $pageTitle)
 {
     $documentConfig = new ConfigEntity();
     $documentConfig->set('instanceId', $pageId);
     $documentConfig->set('instanceName', $pageTitle);
     $this->document->getInstanceManager()->add($documentConfig);
 }
Esempio n. 7
0
 /**
  * create default dynamic field
  *
  * @param ConfigEntity $boardConfig board config entity
  * @deprecated
  */
 protected function createDefaultDynamicField(ConfigEntity $boardConfig)
 {
     $category = Category::create(['name' => 'board-default']);
     $config = new ConfigEntity();
     foreach (['group' => $boardConfig->get('documentGroup'), 'revision' => $boardConfig->get('revision'), 'id' => 'category', 'typeId' => 'FieldType/xpressengine@Category', 'label' => 'board::category', 'skinId' => 'FieldType/xpressengine@Category/FieldSkin/xpressengine@default', 'use' => true, 'searchable' => true, 'required' => true, 'sortable' => false, 'tableMethod' => false, 'categoryId' => $category->id, 'colorSet' => 'default', 'joinColumnName' => 'id'] as $key => $value) {
         $config->set($key, $value);
     }
     $this->dynamicField->create($config);
 }