Resolve a transformer binding instance.

@throws \RuntimeException

@return object
337767
public function resolveTransformer()
    {
        if (is_string($this->resolver)) {
            return $this->container->make($this->resolver);
        } elseif (is_callable($this->resolver)) {
            return call_user_func($this->resolver, $this->container);
        } elseif (is_object($this->resolver)) {
            return $this->resolver;
        }

        throw new RuntimeException('Unable to resolve transformer binding.');
    }
566083
protected function resolveTransformerForResource($resource)
    {
        $transformer = null;

        if ($this->transformerResolver !== null) {
            $transformer = $this->transformerResolver->resolve($resource);
        }

        return $transformer;
    }
1289449
public function propertyFactory()
    {
        if (!isset($this->propertyFactory)) {
            throw new RuntimeException(sprintf(
                'Property Factory is not defined for [%s]',
                get_class($this)
            ));
        }

        return $this->propertyFactory;
    }
185965
public function getAdapter()
    {
        if (isset($this->adapter)) {
            return $this->adapter;
        }
        if (isset($this->options['connection'])) {
            if (!($this->options['connection'] instanceof \PDO)) {
                throw new \RuntimeException('The specified connection is not a PDO instance');
            }

            $this->options['connection']->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
            $this->options['adapter'] = $this->options['connection']->getAttribute(\PDO::ATTR_DRIVER_NAME);
        }
        if (!isset($this->options['adapter'])) {
            throw new \RuntimeException('No adapter was specified for environment: ' . $this->getName());
        }

        $factory = AdapterFactory::instance();
        $adapter = $factory
            ->getAdapter($this->options['adapter'], $this->options);

        // Automatically time the executed commands
        $adapter = $factory->getWrapper('timed', $adapter);

        if (isset($this->options['wrapper'])) {
            $adapter = $factory
                ->getWrapper($this->options['wrapper'], $adapter);
        }

        if ($this->getCommand()) {
            $adapter->setCommand($this->getCommand());
        }

        // Use the TablePrefixAdapter if table prefix/suffixes are in use
        if ($adapter->hasOption('table_prefix') || $adapter->hasOption('table_suffix')) {
            $adapter = AdapterFactory::instance()
                ->getWrapper('prefix', $adapter);
        }

        $this->setAdapter($adapter);

        return $adapter;
    }
1067706
public function obj()
    {
        if ($this->obj === null) {
            $formGroup = $this->formGroup();
            if ($formGroup instanceof self) {
                $prop = $formGroup->storageProperty();
                $val  = $formGroup->obj()->propertyValue($prop->ident());

                $this->obj = $prop->structureVal($val, [ 'default_data' => true ]);
                if ($this->obj === null) {
                    $this->obj = clone $prop->structureProto();
                }
            } elseif ($this->form() instanceof ObjectContainerInterface) {
                $this->obj = $this->form()->obj();
            }

            if ($this->obj === null) {
                throw new RuntimeException(sprintf(
                    'The [%1$s] widget has no data model.',
                    static::CLASS
                ));
            }
        }

        return $this->obj;
    }
446443
public function getTag()
	{
		if (!isset($this->tagName))
		{
			throw new RuntimeException('No tag associated with this plugin');
		}

		return $this->configurator->tags[$this->tagName];
	}
637549
public function tell()
    {
        $this->valideAttach();
        if (($stream = ftell($this->stream)) === false) {
            throw new \RuntimeException('An error has occurred.');
        }

        return $stream;
    }
1304036
private function resolveContainer(): ContainerInterface
    {
        if ($this->container === null) {
            $container = $this->containerFactory->build($this);

            if (!$container instanceof ContainerInterface) {
                throw new \RuntimeException(
                    "Invalid factory result, expected ContainerInterface"
                );
            }

            $this->container = $container;
        }

        return $this->container;
    }
25447
public function getTransformer($value): Transformer
    {
        foreach ($this->getAllTransformers() as $transformer) {
            if ($transformer->canTransform($value)) {
                return $transformer;
            }
        }

        throw Untransformable::noTransformerFound($value);
    }
1151125
protected function propertyFactory()
    {
        if ($this->propertyFactory === null) {
            throw new RuntimeException(sprintf(
                'Model [%s] does not have a property factory.',
                get_class($this)
            ));
        }

        return $this->propertyFactory;
    }
883511
public function getResolver(){
		if(!isset($this->resolver)){
			$this->resolver = new MultiTypeResolver($this->container, getcwd());
		}
		return $this->resolver;
	}
450625
public function proto()
    {
        $objType = $this->objType();
        if (!$objType) {
            throw new RuntimeException('Can not create prototype, object type is undefined');
        }

        return $this->modelFactory()->get($objType);
    }
1124744
public function resolve($value)
    {
        foreach ($this->transformers as $transformer) {
            if ($transformer->supports($value)) {
                return $transformer;
            }
        }

        return new NullTransformer();
    }
1103756
public function getOptions()
    {
        if (!$this->options) {
            throw new Exception\RuntimeException(sprintf(
                'No options instance set for the adapter "%s"',
                get_class($this)
            ));
        }
        return $this->options;
    }
90599
public function recover()
    {
        if (! class_exists($this->class)) {
            return new RuntimeException($this->message);
        }

        try {
            $reflection = new ReflectionClass($this->class);

            $e = $reflection->newInstanceWithoutConstructor();

            if (! $e instanceof Throwable) {
                throw new RuntimeException("Class [{$this->class}] is not an exception.");
            }

            foreach ($reflection->getProperties() as $property) {
                $name = $property->getName();

                if (isset($this->properties[$name])) {
                    $value = $this->properties[$name];

                    $property->setAccessible(true);

                    $property->setValue($e, $value instanceof Serialization ? $value->recover() : $value);
                }
            }

            return $e;
        } catch (Throwable $ex) {
            return new RuntimeException($this->message);
        }
    }
216231
protected function resolveTransformer(Model $model, $transformer = null)
    {
        $transformer = $transformer ?: $this->resolveTransformerFromModel($model);

        if (is_string($transformer)) {
            $transformer = new $transformer;
        }

        return $this->parseTransformer($transformer, $model);
    }
733672
protected function factory()
    {
        if ($this->factory === null) {
            throw new RuntimeException(
                sprintf('Model Factory is not defined for "%s"', get_class($this))
            );
        }

        return $this->factory;
    }