聘我网

新概念招聘3.0

如何解读BNF?

vote up0vote downstar

例如DQLBNF,怎么理解?

 

1 个答复

vote up0vote downcheck

BNF(Backus-Naur Form,巴科斯范式)常用于描述语法

我们先用DQL API来写一句查询:

$result = Doctrine_Query::create()
    ->select('p.id, p.title, u.login')
            ->from('Ab_Model_Post p')
            ->innerJoin('p.User u')
            ->where('p.codeStatus = ?')
            ->orderBy('p.date desc')
            ->limit(2)
            ->execute(array('OK'), Doctrine::HYDRATE_ARRAY);

然后再用DQL语言来写:

$result = Doctrine_Query::create()
    ->query(<<<DQL
select p.id, p.title, u.login
from Ab_Model_Post as p, 
    p.User u
where p.codeStatus = ?
order by p.date desc
limit 2
DQL
    , array('OK'), Doctrine::HYDRATE_ARRAY);

结果是相同的

链接

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.