/** * Magic will either call a function on the file if it exists or bubble to parent * @see EMongoDocument::__call() */ public function __call($name, $parameters) { if ($this->getFile() instanceof MongoGridFSFile && method_exists($this->getFile(), $name)) { return call_user_func_array(array($this->getFile(), $name), $parameters); } return parent::__call($name, $parameters); }