public function __call($name, $arguments) { if (method_exists($this->client, 'send_' . $name)) { $unwrapper = new Unwrapper($this->dm); foreach ($arguments as $k => $argument) { if (is_object($argument)) { $unwrapper->cascadeRemovePersistentCollections($argument); } } } $result = call_user_func_array(array($this->client, $name), $arguments); return $result; }
public function __call($name, $arguments) { $result = call_user_func_array(array($this->hander, $name), $arguments); $unwrapper = new Unwrapper($this->dm); if (is_object($result)) { $unwrapper->cascadeRemovePersistentCollections($result); } elseif (is_array($result)) { foreach ($result as $eachResult) { $unwrapper->cascadeRemovePersistentCollections($eachResult); } } return $result; }