I have a AbstractTableGateway
like this:
class FundsTable extends AbstractTableGateway
{
protected $table = 'tb_funds';
public function __construct(AdapterInterface $adapter)
{
$this->adapter = $adapter;
$this->resultSetPrototype = new HydratingResultSet(new FundsHydrator(), new Fund());
$this->initialize();
}
public function fetchAll($year)
{
$select = new Select(array("f" => $this->table));
$resultSet = $this->selectWith($select);
$resultSet->initialize($resultSet->toArray());
return $resultSet;
}
}
And i would like to check something before return the $resultSet
in fetchAll
method, but i have a lot of this methods and dont want to put a if or a where in each of them, would like to make a function uncoupled of the class, i tried to use a EventFeature
of TableGateway
but the zend is lack of documentation about that.
Did you guys have any suggestions?
Thanks