开发者

Doctrine to Propel snippet

开发者 https://www.devze.com 2022-12-17 00:33 出处:网络
I am using the Propel ORM with SF (1.4). I am writing a class, and I need to rewrite a query Doctrine query into Propel:

I am using the Propel ORM with SF (1.4). I am writing a class, and I need to rewrite a query Doctrine query into Propel:

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

  if ($q-开发者_如何学C>count()){ // Do Something }

can anyone help with the conversion?


Try it and fix column names:

$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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号