/** * Returns data for the first level children of the tag identified by given $tagId. * * @throws \RuntimeException * * @param mixed $tagId * @param int $offset The start offset for paging * @param int $limit The number of tags returned. If $limit = -1 all children starting at $offset are returned * @param string[] $translations * @param bool $useAlwaysAvailable * * @return array */ public function getChildren($tagId, $offset = 0, $limit = -1, array $translations = null, $useAlwaysAvailable = true) { try { return $this->innerGateway->getChildren($tagId, $offset, $limit, $translations, $useAlwaysAvailable); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * Loads children of a tag identified by $tagId. * * @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If the specified tag is not found * * @param mixed $tagId * @param int $offset The start offset for paging * @param int $limit The number of tags returned. If $limit = -1 all children starting at $offset are returned * @param string[] $translations * @param bool $useAlwaysAvailable * * @return \Netgen\TagsBundle\SPI\Persistence\Tags\Tag[] */ public function loadChildren($tagId, $offset = 0, $limit = -1, array $translations = null, $useAlwaysAvailable = true) { $tags = $this->gateway->getChildren($tagId, $offset, $limit, $translations, $useAlwaysAvailable); return $this->mapper->extractTagListFromRows($tags); }