$user = Doctrine_Core::getTable开发者_如何学运维('User')
->createQuery('u')
->innerJoin('u.Profile p')
->where('p.username = ?', 'jwage')
->fetchOne();
It looks quite different from SQL which I'm quite used to,especially what does the u
mean?
Can someone make it clear by a decent explanation?
$q = Doctrine::getTable('User')->createQuery('u')->where('u.username = ?', 'JRL');
is a shorthand method for this:
$q = Doctrine_Query::create()->from('User u')->where('u.username = ?', 'JRL');
The createQuery
method is declared as such: createQuery($alias = '')
Seems to me like the u
means the User
table. It's just a short alias for it.
精彩评论