In Zendframework 1 we use the following code in the models to apply where and order by clauses:
$this->select()
->where('WHERE CLAUSE')
->order('ORDER FIELDS');
But in Zendframework 2 it has been changed to:
$this->select('WHERE CLAUSE');
I dont know how to apply order by clause to my select object.
There are actually several ways to achieve where-clauses in ZF2, the most ‘nerdy’ one being
As for the orther, it’s the same as in ZF1
Read more about the possibilities inside the Official Documentation of \Zend\Db\Sql