Create context from defined members.

@return RenderingContext
187387
public function createContext()
    {
        // context options
        $resolvedOptions = $this->optionsResolver->resolve($this->options);
        $resolvedOptions['content'] = $this->contentResolver->resolve(
            $resolvedOptions['content']
        );

        // create variation
        $variation = $this->variationResolver->resolve(
            (new VariationContext())->denormalize($resolvedOptions)
        );

        return new RenderingContext(
            $resolvedOptions['content'],
            $resolvedOptions['theme'],
            $this->templateResolver->resolve(
                $resolvedOptions['theme'],
                $resolvedOptions['content'],
                $variation,
                $resolvedOptions['templateTypeName']
            ),
            $variation
        );
    }
977144
public function context(Context $context = null) : Context
    {
        if (!$this->context) {
            $this->context = $context ?: new SimpleContext;
        }

        return $this->context;
    }
334259
public function getContext()
    {
        if ($this->context === null) {
            $this->context = array_map(
                'League\JsonGuard\as_string',
                [
                    self::KEYWORD     => $this->keyword,
                    self::PARAMETER   => $this->parameter,
                    self::DATA        => $this->data,
                    self::DATA_PATH   => $this->dataPath,
                    self::SCHEMA      => $this->schema,
                    self::SCHEMA_PATH => $this->schemaPath,
                    self::CAUSE       => $this->getCause(),
                ]
            );
        }

        return $this->context;
    }
1002336
public function render($context = null)
    {
        try {
            return $this->_render($context);
        } catch (InvalidArgumentException $e) {
            throw $e;
        } catch (RootException $e) {
            throw $this->_createTemplateRenderException($this->__('Could not render placeholder template'), null, $e, $this, $context);
        }
    }
1062992
private function initializeSessionContext()
    {
        $sessionServer = SessionServer::create($this)->getValue();
        $this->sessionContext = SessionContext::create($sessionServer);
    }
451581
protected function proxy() {
        if (!$this->context) {
            $this->context = new MemberContext(
                $this->version,
                $this->solution['accountSid'],
                $this->solution['queueSid'],
                $this->solution['callSid']
            );
        }

        return $this->context;
    }
611048
protected function createNew(Context $context)
    {
        $resource = $this->getRepository()->createNew();

        if (null !== $context && $this->hasParent()) {
            $parentConfig = $this->getParent()->getConfiguration();
            $parentResourceName = $parentConfig->getResourceName();
            //$parentResourceNamePlural = $parentConfig->getResourceName(true);
            $parent = $context->getResource($parentResourceName);

            /** @var \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata */
            $metadata = $this->get($this->config->getServiceKey('metadata'));

            // Look for many to one
            if ($metadata->hasAssociation($parentResourceName)) {
                $mapping = $metadata->getAssociationMapping($parentResourceName);
                if ($mapping['type'] === ClassMetadataInfo::MANY_TO_ONE) {
                    try {
                        $propertyAccessor = PropertyAccess::createPropertyAccessor();
                        $propertyAccessor->setValue($resource, $parentResourceName, $parent);
                    } catch (\Exception $e) {
                        throw new \RuntimeException('Failed to set resource\'s parent.');
                    }
                } else {
                    throw new \RuntimeException(sprintf('"%s" is not a supported association type.', $parentResourceName));
                }
                // Look for many to many
            } /*elseif ($metadata->hasAssociation($parentResourceNamePlural)) {
                $mapping = $metadata->getAssociationMapping($parentResourceNamePlural);
                if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY) {
                    try {
                        call_user_func(array($resource, 'add'.ucfirst($parentResourceName)), $parent);
                    } catch (\Exception $e) {
                        throw new \RuntimeException('Failed to associate resource with his parent.');
                    }
                } else {
                    throw new \RuntimeException(sprintf('"%s" is not a supported association type.', $parentResourceNamePlural));
                }
            }*/ else {
                throw new \RuntimeException(sprintf('Association "%s" not found.', $parentResourceName));
            }
        }

        return $resource;
    }
414037
public function render($context = [])
    {
        $this->setAttribute('value', $this->getInstanceValue());
        $data = parent::render($context);
        if ($this->isMultiple()) {
            $this->updateInstance();
        }
        return $data;
    }
154315
public function render()
    {
        $context = $this->getCommandContext();
        $context->data = $this->_contents;
                
        $result = $this->getCommandChain()->run(LibBaseTemplateFilter::MODE_WRITE, $context);
        
        return $context->data;
    }
1219600
public function getContext()
    {
        $context = new KDispatcherContext();

        $context->setSubject($this);
        $context->setRequest($this->getRequest());
        $context->setResponse($this->getResponse());
        $context->setUser($this->getUser());

        return $context;
    }
482463
public function render($context = [])
    {
        $this->getRenderer()->setElement($this);
        return $this->getRenderer()->render($context);
    }
1185750
function render($context = null, $vars = array())
    {
        $directives = $this->getDirectives();

        foreach ($directives as $directive) {
            list($i, $name, $argv) = $directive;
            $this->executeDirective($name, $context, $argv);
        }

        return $this->getProcessedSource();
    }
393654
public function render($context)
    {
        if (count($this->class) > 0) {
            foreach ($this->class as $class) {
                $this->getRow()->addClass($class);
            }
        }
        return $context;
    }
103865
protected function createGenericContext()
    {
        if ($this->isCreatingContext) {
            return null;
        }

        $this->isCreatingContext = true;

        $obj = $this->modelFactory()->create($this->genericContextClass());

        $baseUrl = $this->baseUrl();
        if ($this->routeEndpoint) {
            $endpoint = $this->translator()->translation($this->routeEndpoint);
            foreach ($this->translator()->availableLocales() as $lang) {
                $uri = $baseUrl->withPath($endpoint[$lang]);

                if ($this->routeGroup) {
                    $uri = $uri->withBasePath($this->routeGroup[$lang]);
                }

                $base = $uri->getBasePath();
                $path = $uri->getPath();
                $path = $base . '/' . ltrim($path, '/');

                $endpoint[$lang] = $path;
            }
        } else {
            $endpoint = null;
        }

        $obj['url']   = $endpoint;
        $obj['title'] = $this->title();

        $this->isCreatingContext = false;

        return $obj;
    }
1343047
protected function loadContextObject()
    {
        $route = $this->getObjectRouteFromPath();

        $obj = $this->modelFactory()->create($route->routeObjType());
        $obj->load($route->routeObjId());

        return $obj;
    }
1181398
public function getContext() {
        return new StepContextContext(
            $this->version,
            $this->solution['flowSid'],
            $this->solution['engagementSid'],
            $this->solution['stepSid']
        );
    }
274658
protected function _actionCreate(ModelContext $context)
    {
        //Get the data
        $data = ModelContext::unbox($context->properties);

        if(!is_numeric(key($data))) {
            $data = array($data);
        }

        //Entity options
        $options = array(
            'data'            => $data,
            'identity_column' => $context->getIdentityKey()
        );

        return $this->getTable()->createRowset($options);
    }