Add custom column in Propel


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $c = new Criteria();
  2.  
  3. $c->addAsColumn('brandname', '(SELECT brand.name FROM brand WHERE brand.id=brand_id)');
  4.  
  5. $c->addAscendingOrderByColumn($c->getColumnForAs('brandname'));
  6.  
  7. $this->products = ProductPeer::doSelect($c);

URL: http://snippets.symfony-project.org/snippet/269

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.