@param array|null $context

@throws InvalidValueDataException
@throws MissingAttributeException
@throws ContextException

@return string
486112
public function getLabel(array $context = null)
    {
        if ($this->getFamily()->hasAttribute('label')) {
            return $this->getValueData($this->getAttribute('label'), $context);
        }
        $label = null;
        try {
            $label = $this->getLabelValue($context);
        } catch (\Exception $e) {
        }
        if (null === $label && $this->getIdentifier()) {
            $label = "[{$this->getIdentifier()}]";
        }

        return $label;
    }
1295109
public function listAction($context = null)
    {
        return new JsonResponse([
            'widgets' => array_map(function (Widget $widget) {
                return $this->serializer->serialize($widget);
            }, $this->widgetManager->getAvailable($context)),
            'dataSources' => array_map(function (DataSource $dataSource) {
                return $this->serializer->serialize($dataSource);
            }, $this->dataSourceManager->getAvailable($context)),
        ]);
    }
920660
public function render($context)
    {
        if (count($this->attr) > 0) {
            foreach ($this->attr as $name => $value) {
                $this->getCell()->addVarAttr($name, $value);
            }
        }
        return $context;
    }
811477
protected function getAdapter($context) {
    return $this->context === $context || $context === NULL ? $this : new static($this->entityMeta, $context);
  }
135682
public static function constants($context) {
        if ($context['flags']['standalone'] == 0) {
            return 'array()';
        }

        $class = new \ReflectionClass($context['runtime']);
        $constants = $class->getConstants();
        $ret = " array(\n";
        foreach($constants as $name => $value) {
            $ret .= "            '$name' => ".  (is_string($value) ? "'$value'" : $value ) . ",\n";
        }
        $ret .= "        )";
        return $ret;
    }
323464
public function get($attributeCode, array $context = null)
    {
        $attribute = $this->getAttribute($attributeCode);

        $getter = 'get'.ucfirst($attributeCode);
        if (method_exists($this, $getter)) {
            return $this->$getter($context);
        }

        if ($attribute->isCollection()) {
            return $this->getValuesData($attribute, $context);
        }

        return $this->getValueData($attribute, $context);
    }
391860
public function render(array $data, ContextInterface $context)
    {
        $data = optionsParser($data, [
            'name' => '',
            'val' => null,
            'type' => 'text',
            'escape' => true,
            'templateVars' => [],
        ]);
        $data->add('value', $data->consume('val'));

        return $this->_templates->format('hidden', [
            'name' => $data->get('name'),
            'type' => $data->get('type'),
            'templateVars' => $data->get('templateVars'),
            'attrs' => $this->_templates->formatAttributes($data->toArray(), ['name', 'type']),
        ]);
    }
92046
protected function printContext(array $context)
    {
        $res = '';
        foreach ($context as $name => $val) {
            // bypass internal context
            if (substr($name, 0, 2) === '__') {
                continue;
            }

            // concat contexts
            $res .= " $name: " . strval($val);
        }
        return $res ?: '';
    }
1003004
public static function getArrayDotValue( array $context , $name )
	{
		$pieces = explode( '.' , $name );
		foreach ( $pieces as $piece )
		{
			if ( ! is_array( $context ) || ! array_key_exists( $piece , $context ) )
			{
				return null;
			}
			$context = $context[ $piece ];
		}

		return $context;
	}
1329197
public function getSeoPageContext($context)
    {
        if (isset($this->seoPagesContext[$context])) {
            return $this->seoPagesContext[$context];
        }
        $contextTemplate = $this->findOneBy(['context' => $context]);

        if ($contextTemplate) {
            $this->seoPagesContext[$context] = $contextTemplate;

            return $this->seoPagesContext[$context];
        }

        return null;
    }
741682
public function dataValue()
    {
        $result = null;
        if (is_array($this->value)) {
            $this->value = $this->arrayFilterEmptyRecursive($this->value);
            $result = (!empty($this->value)) ? Convert::array2json($this->value) : $result;
        } else {
            $result = parent::dataValue();
        }

        return $result;
    }
394467
private function parseContext($context)
    {
        $debugBackTrace = debug_backtrace();
        if(!isset($context['trace']))
        {
            $context['trace'] = $this->getTrace($debugBackTrace);
        }
        if(!isset($context['errorFile']))
        {
            list($file, $line) = $this->getErrorFile($debugBackTrace);
            $context['errorFile'] = $file;
            $context['errorLine'] = $line;
        }
        return $context;
    }
39227
protected function buildMessage(array $context): string
    {
        $message = $this->message ?: '{name} took {lapse} seconds.';

        return Str::replace($message, $context);
    }
558135
public function render($context)
    {
        $values = array();

        foreach ($this->vars as $var) {
            $actualRow = $this->getRow()->getActualRow();
            $values[] = $actualRow[$var];
        }
        $value = vsprintf($this->value, $values);

        $this->getRow()->addVarAttr($this->name, $value);
        return $context;
    }
1158320
private function getParameterFromContext(array $context, string $parameterName, $default = null)
    {
        $filters = $context['filters'] ?? [];

        return \array_key_exists($parameterName, $filters) ? $filters[$parameterName] : $default;
    }
1061457
protected function getAttributeValue($object, $attribute, $format = null, array $context = [])
    {
        $context['api_attribute'] = $attribute;
        $propertyMetadata = $this->propertyMetadataFactory->create($context['resource_class'], $attribute, $this->getFactoryOptions($context));

        try {
            $attributeValue = $this->propertyAccessor->getValue($object, $attribute);
        } catch (NoSuchPropertyException $e) {
            if (!$propertyMetadata->hasChildInherited()) {
                throw $e;
            }

            $attributeValue = null;
        }

        $type = $propertyMetadata->getType();

        if (
            is_iterable($attributeValue) &&
            $type &&
            $type->isCollection() &&
            ($collectionValueType = $type->getCollectionValueType()) &&
            ($className = $collectionValueType->getClassName()) &&
            $this->resourceClassResolver->isResourceClass($className)
        ) {
            return $this->normalizeCollectionOfRelations($propertyMetadata, $attributeValue, $className, $format, $this->createChildContext($context, $attribute));
        }

        if (
            $type &&
            ($className = $type->getClassName()) &&
            $this->resourceClassResolver->isResourceClass($className)
        ) {
            return $this->normalizeRelation($propertyMetadata, $attributeValue, $className, $format, $this->createChildContext($context, $attribute));
        }

        unset($context['resource_class']);

        if (!$this->serializer instanceof NormalizerInterface) {
            throw new LogicException(sprintf('The injected serializer must be an instance of "%s".', NormalizerInterface::class));
        }

        return $this->serializer->normalize($attributeValue, $format, $context);
    }
1200218
public static function fromV2ToV1(array $context): array
    {
        $result = [];
        foreach ($context as $key => $value) {
            $result[] = ['key' => $key, 'value' => $value];
        }

        return $result;
    }