public function __call($m, $a)
{
switch ($m) {
case 'update':
case 'load':
case 'delete':
return call_user_func_array(array($this, '_' . $m), $a);
break;
// XXX: can dispatch methods to Schema object.
// return call_user_func_array( array( ) )
break;
}
// Dispatch to schema object method first
$schema = $this->getSchema();
if (method_exists($schema, $m)) {
return call_user_func_array(array($schema, $m), $a);
}
// then it's the mixin methods
if ($mClass = $this->findMixinMethodClass($m)) {
return $this->invokeMixinClassMethod($mClass, $m, $a);
}
// XXX: special case for twig template
throw new BadMethodCallException(get_class($this) . ": {$m} method not found.");
}