Esempio n. 1
0
 /**
  * drop instance
  *
  * @param ConfigEntity $config 현재 설정 되어 있는 config
  * @return void
  */
 public function remove(ConfigEntity $config)
 {
     $this->connection->beginTransaction();
     $this->configHandler->remove($config);
     $this->dropDivisionTable($config);
     $this->connection->commit();
 }
 /**
  * DynamicField 제거
  *
  * @param ConfigEntity $config config entity
  * @return void
  */
 public function drop(ConfigEntity $config)
 {
     $this->connection->beginTransaction();
     $this->configHandler->remove($config);
     $type = $this->registerHandler->getType($this, $config->get('typeId'));
     $type->setConfig($config);
     $type->drop();
     $this->connection->commit();
 }
 /**
  * delete document
  *
  * @param DocumentEntity $doc    document entity
  * @param ConfigEntity   $config config entity
  * @return int
  */
 public function delete(DocumentEntity $doc, ConfigEntity $config)
 {
     $this->connection->beginTransaction();
     if ($config->get('revision') === true) {
         $this->revision->delete($doc);
     }
     $count = $this->document->delete($doc, $config);
     $this->connection->commit();
     return $count;
 }
 /**
  * unrelated file
  *
  * @param string $targetId target identifier
  * @param string $id       file identifier
  * @return void
  * @throws Exception
  */
 public function unRelating($targetId, $id)
 {
     if ($row = $this->findRelationOne($targetId, $id)) {
         $this->conn->beginTransaction();
         try {
             $row = (array) $row;
             $this->conn->table($this->relationTable)->where('id', $row['id'])->delete();
             $this->conn->table($this->table)->where('id', $id)->orWhere('parentId', $id)->decrement('useCount');
         } catch (Exception $e) {
             $this->conn->rollBack();
             throw $e;
         }
         $this->conn->commit();
     }
 }
Esempio n. 5
0
 /**
  * 게시판 제거
  *
  * @param string $boardId board id
  * @return void
  */
 public function destroy($boardId)
 {
     $config = $this->configHandler->get($boardId);
     if ($config === null) {
         throw new Exceptions\InvalidConfigException();
     }
     $this->conn->beginTransaction();
     // get document config
     $this->document->destroyInstance($boardId);
     $this->comment->drop($boardId);
     // remove board config
     $this->configHandler->remove($config);
     // 연결된 df 제거
     foreach ($this->configHandler->getDynamicFields($config) as $config) {
         $this->dynamicField->drop($config);
     }
     $this->conn->commit();
 }
 /**
  * delete document
  *
  * @param Document $doc document model
  * @return bool
  */
 public function remove(Document $doc)
 {
     $this->conn->beginTransaction();
     $result = $doc->delete();
     $this->conn->commit();
     return $result;
 }