0

我只有 DQL 有一个奇怪的错误,存储库查询有效。当我移动到 prod 环境时,这两个查询都在 localhost 中工作:

    $entity = $em->getRepository('PanasonicTestEtAvisBundle:Review')->findAll();

这行得通。

    $entity = $em->createQuery('SELECT t.id FROM PanasonicTestEtAvisBundle:Review t')->getResult();

这失败并出现以下错误:

Parse error: syntax error, unexpected $end in /home/sites_web/client/xxx/vendor/doctrine/lib/Doctrine/ORM/Query/Parser.php on line 1660

第 1660 行有:

if ($this->_isAggregateFunction($this->_lexer->lookahead['type'])) {
            return $this->AggregateExpression();
        } else {
            return $this->FunctionDeclaration();
        }

我的日志:

[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onEarlyKernelRequest". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". [] []
[2012-05-09 14:04:49] security.DEBUG: Read SecurityContext from the session [] []
[2012-05-09 14:04:49] security.DEBUG: Reloading user from user provider. [] []
[2012-05-09 14:04:49] security.DEBUG: Username "user" was reloaded from user provider. [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\RouterListener::onKernelRequest". [] []
[2012-05-09 14:04:49] request.INFO: Matched route "review_edit" (parameters: "_controller": "Panasonic\TestEtAvisBundle\Controller\BOReviewController::editAction", "id": "1", "productid": "1", "_route": "review_edit") [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.request" to listener "Knp\Bundle\PaginatorBundle\Subscriber\SlidingPaginationSubscriber::onKernelRequest". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RequestDataCollector::onKernelController". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.controller" to listener "Acme\DemoBundle\ControllerListener::onKernelController". [] []
[2012-05-09 14:04:49] event.DEBUG: Notified event "kernel.controller" to listener "JMS\SecurityExtraBundle\Controller\ControllerListener::onCoreController". [] []

我最终需要使用 DQL 来获取与 knp 分页包和连接等一起使用的查询......任何帮助都将不胜感激。

4

1 回答 1

1

结果在使用 CuteFTP 将文件传输到服务器时,1 个或多个文件没有完全传输,因此导致了这个奇怪的错误。它现在应该正常工作。

于 2012-05-10T05:30:33.120 回答