【问题标题】:Select only specific relation of relatiojn Doctrine 1.2仅选择关系学说 1.2 的特定关系
【发布时间】:2013-08-05 13:23:27
【问题描述】:

因此,我有关系查询的关系,我只想为表 CancellationRequest c 选择最近创建的记录。

任何人知道这是否/应该可能以及如何实现?

Doctrine_Query::create()
    ->from('UserNotificationTo unt')
    ->leftJoin('unt.Notification un')
    ->leftJoin('un.QuoteOrder qo')
    ->leftJoin('qo.CancellationRequest c')
    ->where('un.sent_external = 0')
    ->andWhere('c.updated_at *IS THE MOST RECENTLY CREATED ONE*')
    ->execute();

【问题讨论】:

    标签: doctrine-1.2


    【解决方案1】:

    你必须做 ORDER BY c.updated_at

    那么你可以这样做:

    $userNotifcation->getQuoteOrder()->getCancellationRequest()->first()
    

    获取最新的

    【讨论】:

      猜你喜欢
      • 2020-06-30
      • 2017-01-22
      • 1970-01-01
      • 1970-01-01
      • 2011-11-15
      • 2013-12-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-29
      相关资源
      最近更新 更多