无法在我的带有 postgres 数据库的 symfony 4 项目中使用 Acos doctrine 扩展

can't use Acos doctrine extension in my symfony 4 project with postgres database

我正在尝试在我的 symfony 4 项目中使用数字函数。

我已连接到 postgres 数据库:

DATABASE_URL=pgsql://postgres:postgres@postgres/mydatabase?serverVersion=11

在我的 doctrine.yaml 文件中,我添加了:

doctrine:
    orm:
    ...
       dql:
             numeric_functions:
                 acos: DoctrineExtensions\Query\Mysql\Acos
                 cos: DoctrineExtensions\Query\Mysql\Cos
                 sin: DoctrineExtensions\Query\Mysql\Sin

我尝试向邮递员发出获取请求 我收到此错误消息: "Attempted to load class \"Acos\" 来自命名空间 \"DoctrineExtensions\Query\Mysql\"。\n您是否忘记了另一个命名空间的 \"use\" 语句?",

我认为您在这里遇到了问题,因为您连接到 Postgres 数据库,但尝试使用 MySQL 的扩展(您可以在扩展路径 'DoctrineExtensions\Query*Mysql*\Acos' 中看到它)