getInstanceManager() public method

get repository
public getInstanceManager ( ) : InstanceManager
return InstanceManager
Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
 /**
  * 게시판 설정 변경
  *
  * @param array $params parameters
  * @return ConfigEntity
  */
 public function updateConfig(array $params)
 {
     if (empty($params['boardId']) === true) {
         throw new RequiredValueException();
     }
     $config = $this->configHandler->get($params['boardId']);
     if ($config === null) {
         throw new InvalidConfigException();
     }
     $params = array_merge($config->getPureAll(), $params);
     $this->conn->beginTransaction();
     $config = $this->configHandler->put($params);
     $configHandler = $this->document->getConfigHandler();
     $documentConfig = $configHandler->makeEntity($params['boardId'], $params);
     $this->document->getInstanceManager()->put($documentConfig);
     $this->conn->commit();
     return $config;
 }
Ejemplo n.º 3
0
 /**
  * 게시판 설정 변경
  *
  * @param array $params parameters
  * @return ConfigEntity
  */
 public function updateConfig(array $params)
 {
     if (empty($params['boardId']) === true) {
         throw new RequiredValueException(['key' => 'boardId']);
     }
     $config = $this->configHandler->get($params['boardId']);
     if ($config === null) {
         throw new InvalidConfigException();
     }
     $configHandler = $this->document->getConfigHandler();
     $documentConfig = $configHandler->get($params['boardId']);
     foreach ($params as $key => $value) {
         $config->set($key, $value);
         $documentConfig->set($key, $value);
     }
     $this->conn->beginTransaction();
     $config = $this->configHandler->put($config->getPureAll());
     $this->document->getInstanceManager()->put($documentConfig);
     $this->conn->commit();
     return $config;
 }
 /**
  * test get property
  *
  * @return void
  */
 public function testGetProperty()
 {
     $conn = $this->conn;
     $repo = $this->repo;
     $configHandler = $this->configHandler;
     $instanceManager = $this->instanceManager;
     $request = $this->request;
     $handler = new DocumentHandler($conn, $repo, $configHandler, $instanceManager, $request);
     $this->assertInstanceOf('Xpressengine\\Document\\ConfigHandler', $handler->getConfigHandler());
     $this->assertInstanceOf('Xpressengine\\Document\\RepositoryInterface', $handler->getRepository());
     $this->assertInstanceOf('Xpressengine\\Document\\InstanceManager', $handler->getInstanceManager());
 }