/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$c = new Criteria(); $c->addAsColumn('brandname', '(SELECT brand.name FROM brand WHERE brand.id=brand_id)'); $c->addAscendingOrderByColumn($c->getColumnForAs('brandname')); $this->products = ProductPeer::doSelect($c);
URL: http://snippets.symfony-project.org/snippet/269