/** * Returns an array with basic tag data. * * @throws \RuntimeException * * @param mixed $tagId * * @return array */ public function getBasicTagData($tagId) { try { return $this->innerGateway->getBasicTagData($tagId); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * Moves a tag identified by $sourceId into new parent identified by $destinationParentId. * * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If $sourceId or $destinationParentId are invalid * * @param mixed $sourceId * @param mixed $destinationParentId * * @return \Netgen\TagsBundle\SPI\Persistence\Tags\Tag The updated root tag of the moved subtree */ public function moveSubtree($sourceId, $destinationParentId) { $sourceTagData = $this->gateway->getBasicTagData($sourceId); $destinationParentTagData = $this->gateway->getBasicTagData($destinationParentId); $this->gateway->moveSubtree($sourceTagData, $destinationParentTagData); $timestamp = time(); $this->updateSubtreeModificationTime($sourceTagData['parent_id'], $timestamp); $this->updateSubtreeModificationTime($sourceId, $timestamp); return $this->load($sourceId); }