[27.11.2006 23:27] Kevin McArthur wrote:
+ public function offsetGet($offset) {
+ return $this->getRaw($offset);
+ }
Wouldn't it be better to have a default method that can be set and is
used for these interfaces? Like
protected $_defaultMethod = 'getAlpha';
public function setDefaultMethod($method) {
if(!method_exists($this, $method)) {
throw ...;
}
$this->_defaultMethod = $method;
}
public function offsetGet($offset) {
return $this->$method($offset);
}
Of course the default method should also be used in the iterator,
which means Zend_Filter_Input should implement Iterator instead of
IteratorAggregate. But it's not that hard to implement - just a bunch
of additional methods.
nico
PS: somehow this feels like a deja vu. I think there was a discussion
about something like this already.