推理片段的学说

时间:2010-01-19 10:13:47

标签: php symfony1 doctrine propel

我正在使用Propel ORM和SF(1.4)。我正在编写一个类,我需要将查询Doctrine查询重写为Propel:

  $q = Doctrine_Core::getTable('sfGuardRememberKey')->createQuery('r')
        ->innerJoin('r.sfGuardUser u')
        ->where('r.remember_key = ?', $cookie);

  if ($q->count()){ // Do Something }

任何人都可以帮助转换吗?

1 个答案:

答案 0 :(得分:1)

尝试并修复列名:

$c = new Criteria;
$c->addJoin(sfGuardRememberKeyPeer::USER_ID, sfGuardUserPeer::ID, Criteria:INNER_JOIN);
$c->add(sfGuardRememberKeyPeer::REMEMBER_KEY, $cookie);
$result = sfGuardRememberKeyPeer::doSelect($c);
if(count($result)) // do something