Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 未知DQL函数STR_TO_DATE_Sql_Symfony_Doctrine_Dql - Fatal编程技术网

Sql 未知DQL函数STR_TO_DATE

Sql 未知DQL函数STR_TO_DATE,sql,symfony,doctrine,dql,Sql,Symfony,Doctrine,Dql,我得到了这个错误预期的已知函数,得到了'STR\u TO\u DATE' 我的DQL查询: public function findByPresta($prestataire){ $qb = $this->_em->createQueryBuilder() ->select("STR_TO_DATE(c.datepresta,'%d,%M,%Y %h%i%s')") ->from($this->_ent

我得到了这个错误预期的已知函数,得到了'STR\u TO\u DATE'

我的DQL查询:

public function findByPresta($prestataire){
        $qb = $this->_em->createQueryBuilder()
            ->select("STR_TO_DATE(c.datepresta,'%d,%M,%Y %h%i%s')")
            ->from($this->_entityName,'c');

        $result = $qb->getQuery()->getResult();
        return $result;
    }
My Config.yml:

orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true
        dql:
            datetime_functions:
                date_format: Dominos\VodBundle\DQL\Mysql\DateFormat
                strtodate: Dominos\VodBundle\DQL\Mysql\StrToDate

我需要帮助

我已经看到了这个链接,我对DATE_格式做了同样的事情,它是工作,但不是STR_TO_DATE我解决了这个问题,只是用STR_TO_DATE替换strtodate我已经看到了这个链接,我对DATE_格式做了同样的事情,它是工作,但不是STR_TO_DATE我解决了这个问题,只是用STR_TO_DATE替换strtou DATE