/** * Executes create<Entity> methods **/ public function __call($method, $args) { if (preg_match('/create(\\w+)/', $method, $match)) { return $this->_mapper->createEntity(strtolower($match[1]), $args[0], $args[1]); } else { throw new Exception("Unknown method `{$method}'"); } }