mugoweb / ibexa-bundle
为ibexa提供的有用工具
dev-master
2024-07-18 09:34 UTC
Requires
- php: ^7.3
This package is auto-updated.
Last update: 2024-09-18 09:53:17 UTC
README
composer require mugoweb/mugoweb/ibexa-bundle:dev-master
之后,您需要在 config/bundles.php 中启用此包
MugoWeb\IbexaBundle\MugoWebIbexaBundle::class => ['all' => true],
如果您想使用 位置快速查找 或 位置查询测试器 功能,则需要加载此包的 routes.yml 文件。提示:使用 路径前缀 以避免路径冲突。
测试
php bin/phpunit vendor/mugoweb/ibexa-bundle/tests/
功能
位置快速查找
对于给定的位置ID,以下路径重定向到相应内容对象的完整视图
/location/{locationId}
位置查询测试器
它允许您根据给定的LocationQuery字符串获取 位置。
使用此路径访问
/query
用户哈希生成日志
要启用,请将以下内容添加到您的服务配置中
# Enable to log user variation hashes
fos_http_cache.user_context.hash_generator:
class: MugoWeb\IbexaBundle\Service\DebugHashGenerator
arguments:
$cachePool: '@ibexa.cache_pool'
命令
php bin/console ibexa:trash:purge <limit>
清除回收站项的命令
QueryStringParser
以下是一个示例
$query = QueryStringParser::getQueryObject(
'LocationQuery',
'ParentLocationId:123 and ContentTypeIdentifier:article',
'Field.article.publish_date:DESC',
20
);
位置查询和查询
考虑使用QueryStringParser代替。生成LocationQuery的另一种方式。您可以使用它然后用于查找或搜索服务。以下是一个示例
$locationQuery = LocationQuery::build(
'Subtree:' . $parentLocation->pathString . ' and (ContentTypeIdentifier:article or ContentTypeIdentifier:folder ro ContentTypeIdentifier:blog)',
'Location\Priority: ASC',
5
);