I've been trying to get an order ASC/DESC call for a field (let's say craeted), and I can't seem to figure out how to do it in ZF2.
Where am I going wrong..?
namespace Todo\Model;
class TodoTable extends AbstractTableGateway {
public function __construct(Adapter $adapter) {
$this->adapter = $adapter;
$this->resultSetPrototype = new ResultSet();
$this->resultSetPrototype->setArrayObjectPrototype(new Todo());
$this->initialize();
}
public function fetchAll() {
$resultSet = $this->select(array('user_id'=>$this->user_id));
return $resultSet;
}
}
You can use a closure to manipulate the Select object like so:
An example passing through conditions / Where