Iterate Doctrine Collection ordered by some field
问题 I need something like this: $products = Products::getTable()->find(274); foreach ($products->Categories->orderBy('title') as $category) { echo "{$category->title}<br />"; } I know is it not possible, but... How can I do something like this without creating a Doctrine_Query? Thanks. 回答1: I was just looking at the same problem. You need to convert the Doctrine_Collection into an array: $someDbObject = Doctrine_Query::create()...; $children = $someDbObject->Children; $children = $children-