/** * Returns data for tags identified by given $keyword. * * @throws \RuntimeException * * @param string $keyword * @param string $translation * @param bool $useAlwaysAvailable * @param int $offset The start offset for paging * @param int $limit The number of tags returned. If $limit = -1 all tags starting at $offset are returned * * @return array */ public function getTagsByKeyword($keyword, $translation, $useAlwaysAvailable = true, $offset = 0, $limit = -1) { try { return $this->innerGateway->getTagsByKeyword($keyword, $translation, $useAlwaysAvailable, $offset, $limit); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }
/** * Loads tags with specified $keyword. * * @param string $keyword * @param string $translation * @param bool $useAlwaysAvailable * @param int $offset The start offset for paging * @param int $limit The number of tags returned. If $limit = -1 all tags starting at $offset are returned * * @return \Netgen\TagsBundle\SPI\Persistence\Tags\Tag[] */ public function loadTagsByKeyword($keyword, $translation, $useAlwaysAvailable = true, $offset = 0, $limit = -1) { $tags = $this->gateway->getTagsByKeyword($keyword, $translation, $useAlwaysAvailable, $offset, $limit); return $this->mapper->extractTagListFromRows($tags); }