如何注册自定义DQL函数

编辑本页

警告:您正在浏览的文档欧宝官网下载appob娱乐下载Symfony 2.6,现已不再维护。

本页的更新版本用于Syob娱乐下载mfony 6.2(当前稳定版本)。

如何注册自定义DQL函数

Doctrine允许您指定自定义DQL函数。有关此主题的更多信息,请阅读Doctrine的烹饪书文章“' DQL用户定义函数' _”。

在Syob娱乐下载mfony中,您可以按以下方式注册自定义DQL函数:

  • YAML
  • XML
  • PHP
12 3 4 5 6 7 8 9 10 11 12
# app / config / config.yml原则:orm:#……dql:string_functions:test_string:AppBundle \ DQL \ StringFunctionsecond_string:AppBundle \ DQL \ SecondStringFunctionnumeric_functions:test_numeric:AppBundle \ DQL \ NumericFunctiondatetime_functions:test_datetime:AppBundle \ DQL \ DatetimeFunction
此工作,包括代码示例,是根据创作共用BY-SA 3.0许可证。