Code: Select all
interface Command {
public function execute($data);
}
...
public function whatever($data) {
foreach ($this->_commands as $command) {
if ($ret = $command->execute($data)) {
return $ret;
}
}
}EDIT | Sorry, having a blonde moment; I should be using a filter chain.