public function createProxy(HermitContext $ctx, HermitProxy $proxy) { $instance = self::getInstance(); $targetClass = $ctx->getName(); $proxyClass = $instance->transactionProxy[$targetClass]; return new $proxyClass($ctx, $proxy, $instance, 'proceed'); }
protected static function wrap(HermitContext $ctx, HermitProxy $proxy) { if (0 < count(self::$behaviors)) { $targetClass = $ctx->getName(); foreach (self::$behaviors as $behavior) { if ($behavior->has($targetClass)) { return $behavior->createProxy($ctx, $proxy); } } } return $proxy; }