@param \Xervice\DataProvider\Business\Model\DataProvider\DataProviderInterface $provider
@param string $fieldname
@param array $element
@param array $data

@return mixed
196259
private function getDataFromFields(DataProviderInterface $provider, string $fieldname, array $element, array $data)
    {
        $getMethod = 'get' . $fieldname;
        if (strpos($element['type'], 'DataProviderInterface[]') !== false) {
            $data = $this->getDataProviderCollectionData($provider, $fieldname, $data, $getMethod);
        }
        elseif (
            strpos($element['type'], 'DataProviderInterface') !== false
            && $provider->{$getMethod}() instanceof DataProviderInterface
        ) {
            $anyDataProvider = new AnyDataProvider($provider->{$getMethod}());
            $data[$fieldname] = $anyDataProvider->toArray();
        }
        elseif ($element['is_dataprovider'] && $provider->{$getMethod}() instanceof DataProviderInterface) {
            $data[$fieldname] = $this->convertToArray($provider->{$getMethod}());
        }
        elseif ($element['is_collection']) {
            $data = $this->getCollectionData($provider, $fieldname, $data, $getMethod);
        }
        else {
            $data[$fieldname] = $provider->{$getMethod}();
        }
        return $data;
    }
338802
public function Execute( $provider, $dataPool )
	{
		return call_user_func(
			$this->_binaryOper,
			$provider,
			$this->getAbstractNode(0)->Execute( $provider, $dataPool ),
			$this->getAbstractNode(1)->Execute( $provider, $dataPool )
		);
	}
906331
public function provide($data = null, array $options = [])
    {
        $defaultElement = 'CsvMigrations.FieldHandlers/AggregatedFieldHandler/input';
        $element = empty($options['element']) ? $defaultElement : $options['element'];

        $params = [
            'name' => $this->config->getField(),
            'label' => $options['label'],
            'value' => $this->getAggregatedValue($options),
            'attributes' => empty($options['attributes']) ? [] : $options['attributes'],
        ];

        return $this->renderElement($element, $params);
    }
1027214
public function getConfigForElement(array $config, $elementName, $beanName, $customKeyName = 'beans')
    {
        if(!isset($config[$elementName])) {
            return false;
        }

        return $config[$elementName];
    }
186776
protected function generateFieldHtml($fieldKey, $elementKey, $table, $datafield = "data")
    {
        $html = "";
        $fieldHelper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('MASK\\Mask\\Helper\\FieldHelper');
        switch ($fieldHelper->getFormType($fieldKey, $elementKey, $table)) {
            case "Check":
                $html .= "{f:if(condition: " . $datafield . "." . $fieldKey . ", then: 'On', else: 'Off')}<br />\n\n";
                break;
            case "Content":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= "<f:for each=\"{" . $datafield . "." . $fieldKey . "}\" as=\"" . $datafield . "_item" . "\">\n";
                $html .= '<f:cObject typoscriptObjectPath="lib.tx_mask.content">{' . $datafield . '_item.uid}</f:cObject><br />' . "\n";
                $html .= "</f:for>\n";
                $html .= "</f:if>\n\n";
                break;
            case "Date":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.date format="d.m.Y">{' . $datafield . '.' . $fieldKey . '}</f:format.date><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Datetime":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.date format="d.m.Y - H:i:s">{' . $datafield . '.' . $fieldKey . '}</f:format.date><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "File":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:for each="{' . $datafield . '.' . $fieldKey . '}" as="file">
  <f:image image="{file}" alt="{file.alternative}" title="{file.title}" width="200" /><br />
  {file.description} / {file.identifier}<br />
</f:for>' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Float":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.number decimals="2" decimalSeparator="," thousandsSeparator=".">{' . $datafield . '.' . $fieldKey . '}</f:format.number><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Inline":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= "<ul>\n";
                $html .= "<f:for each=\"{" . $datafield . "." . $fieldKey . "}\" as=\"" . $datafield . "_item" . "\">\n<li>";
                $inlineFields = $this->storageRepository->loadInlineFields($fieldKey);
                if ($inlineFields) {
                    foreach ($inlineFields as $inlineField) {
                        $html .= $this->generateFieldHtml($inlineField["maskKey"], $elementKey, $fieldKey,
                                $datafield . "_item") . "\n";
                    }
                }
                $html .= "</li>\n</f:for>" . "\n";
                $html .= "</ul>\n";
                $html .= "</f:if>\n\n";
                break;
            case "Integer":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '{' . $datafield . '.' . $fieldKey . '}<br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Link":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:link.typolink parameter="{' . $datafield . '.' . $fieldKey . '}">{' . $datafield . '.' . $fieldKey . '}</f:link.typolink><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Radio":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:switch expression="{' . $datafield . '.' . $fieldKey . '}">
  <f:case value="1">Value is: 1</f:case>
  <f:case value="2">Value is: 2</f:case>
  <f:case value="3">Value is: 3</f:case>
</f:switch><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Richtext":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.html parseFuncTSPath="lib.parseFunc_RTE">{' . $datafield . '.' . $fieldKey . '}</f:format.html><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Select":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:switch expression="{' . $datafield . '.' . $fieldKey . '}">
  <f:case value="1">Value is: 1</f:case>
  <f:case value="2">Value is: 2</f:case>
  <f:case value="3">Value is: 3</f:case>
</f:switch><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "String":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '{' . $datafield . '.' . $fieldKey . '}<br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Text":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.nl2br>{' . $datafield . '.' . $fieldKey . '}</f:format.nl2br><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
        }
        return $html;
    }
577169
private function createNewDataProvider($provider, PhpNamespace $namespace): ClassType
    {
        $dataProvider = $namespace->addClass($provider . 'DataProvider');
        $dataProvider
            ->setFinal()
            ->setExtends($this->dataProviderExtends)
            ->setImplements(
                [
                    DataProviderInterface::class
                ]
            )
            ->setComment('Auto generated data provider')
        ;

        return $dataProvider;
    }
452178
public function get(string $id): DataProviderInterface
    {
        if (!$this->has($id)) {
            throw new Exception('No data provider with id "'.$id.'" was loaded');
        }

        return $this->dataProviders[$id];
    }
1284996
public function fromNodes( $nodes, $provider, $dataPool )
	{
		$result = new ExprIterator();
		$result->nodes = $nodes;
		$result->provider = $provider;
		$result->dataPool = $dataPool;
		return $result;
	}
916359
public function provide($data = null, array $options = [])
    {
        $template = $this->getBasicTemplate('text');
        $defaultOptions = $this->getDefaultOptions($data, $options);
        $defaultOptions['input'] = ['content' => $template];

        $result[$this->config->getField()] = $defaultOptions;

        $className = $this->config->getProvider('selectOptions');
        $provider = new $className($this->config);

        $selectOptions = $provider->provide($options['fieldDefinitions']->getLimit());

        $view = $this->config->getView();
        $content = $view->Form->select('{{name}}', $selectOptions, [
            'class' => 'form-control',
            'label' => false
        ]);

        foreach ($selectOptions as $key => $value) {
            $result[$this->config->getField()]['options'][] = ['value' => $key, 'label' => $value];
        }
        $result[$this->config->getField()]['input'] = ['content' => $content];

        return $result;
    }
82624
public function provide($data = null, array $options = [])
    {
        $result = [];

        $combinedFields = $this->config->getProvider('combinedFields');
        $combinedFields = new $combinedFields($this->config);
        $combinedFields = $combinedFields->provide($data, $options);

        $view = $this->config->getView();
        foreach ($combinedFields as $suffix => $fieldOptions) {
            $fieldName = $this->config->getField() . '_' . $suffix;

            $config = new $fieldOptions['config']($fieldName, $this->config->getTable());

            $provider = $config->getProvider('renderName');
            $provider = new $provider($config);
            $options['label'] = $provider->provide();

            $provider = $config->getProvider('searchOptions');
            $provider = new $provider($config);

            $type = Inflector::underscore(str_replace('Config', '', (new \ReflectionClass($config))->getShortName()));
            $options['fieldDefinitions']->setName($fieldName);
            $options['fieldDefinitions']->setType($type);

            $result = array_merge($result, (array)$provider->provide($data, $options));
        }

        return $result;
    }
484035
protected function loadElements($tagName, ContainerBuilder $container, $methodForConfiguration, $methodForService)
    {
        $parserName = 'open_orchestra_bbcode.parser';
        $tagName = 'open_orchestra_bbcode.' . $tagName;

        if ($container->hasParameter($tagName)) {
            $parser = $container->getDefinition($parserName);
            $elements = $container->getParameter($tagName);
            $parser->addMethodCall($methodForConfiguration, array($elements));
        }

        $this->addStrategyToManager($container, $parserName, $tagName, $methodForService);
    }
1369472
public function updateByField($fieldName, $fieldValue, array $data)
    {
        $this->manager->postPendingQuery(
            new PendingQuery(
                $this->entity,
                PendingQuery::TYPE_UPDATE,
                $this->getUpdateQuery($data)
                     ->where(
                         $this->equalsExpression($fieldName, $fieldValue)
                     ),
                $this->parameters
            )
        );
    }
771875
public function add($id, DataProviderInterface $dataProvider)
    {
        if ($this->has($id)) {
            throw new Exception('Trying to add the data provider '.$id.' twice');
        }
        // add the data provider to collection, indexed by ids
        $this->dataProviders[$id] = $dataProvider;
    }
1167203
private function prepareQueryElement(string $fieldName, $value = null, ?ClassMetadata $class = null, bool $prepareValue = true, bool $inNewObj = false) : array
    {
        $class = $class ?? $this->class;

        // @todo Consider inlining calls to ClassMetadata methods

        // Process all non-identifier fields by translating field names
        if ($class->hasField($fieldName) && ! $class->isIdentifier($fieldName)) {
            $mapping   = $class->fieldMappings[$fieldName];
            $fieldName = $mapping['name'];

            if (! $prepareValue) {
                return [[$fieldName, $value]];
            }

            // Prepare mapped, embedded objects
            if (! empty($mapping['embedded']) && is_object($value) &&
                ! $this->dm->getMetadataFactory()->isTransient(get_class($value))) {
                return [[$fieldName, $this->pb->prepareEmbeddedDocumentValue($mapping, $value)]];
            }

            if (! empty($mapping['reference']) && is_object($value) && ! ($value instanceof ObjectId)) {
                try {
                    return $this->prepareReference($fieldName, $value, $mapping, $inNewObj);
                } catch (MappingException $e) {
                    // do nothing in case passed object is not mapped document
                }
            }

            // No further preparation unless we're dealing with a simple reference
            if (empty($mapping['reference']) || $mapping['storeAs'] !== ClassMetadata::REFERENCE_STORE_AS_ID || empty((array) $value)) {
                return [[$fieldName, $value]];
            }

            // Additional preparation for one or more simple reference values
            $targetClass = $this->dm->getClassMetadata($mapping['targetDocument']);

            if (! is_array($value)) {
                return [[$fieldName, $targetClass->getDatabaseIdentifierValue($value)]];
            }

            // Objects without operators or with DBRef fields can be converted immediately
            if (! $this->hasQueryOperators($value) || $this->hasDBRefFields($value)) {
                return [[$fieldName, $targetClass->getDatabaseIdentifierValue($value)]];
            }

            return [[$fieldName, $this->prepareQueryExpression($value, $targetClass)]];
        }

        // Process identifier fields
        if (($class->hasField($fieldName) && $class->isIdentifier($fieldName)) || $fieldName === '_id') {
            $fieldName = '_id';

            if (! $prepareValue) {
                return [[$fieldName, $value]];
            }

            if (! is_array($value)) {
                return [[$fieldName, $class->getDatabaseIdentifierValue($value)]];
            }

            // Objects without operators or with DBRef fields can be converted immediately
            if (! $this->hasQueryOperators($value) || $this->hasDBRefFields($value)) {
                return [[$fieldName, $class->getDatabaseIdentifierValue($value)]];
            }

            return [[$fieldName, $this->prepareQueryExpression($value, $class)]];
        }

        // No processing for unmapped, non-identifier, non-dotted field names
        if (strpos($fieldName, '.') === false) {
            return [[$fieldName, $value]];
        }

        /* Process "fieldName.objectProperty" queries (on arrays or objects).
         *
         * We can limit parsing here, since at most three segments are
         * significant: "fieldName.objectProperty" with an optional index or key
         * for collections stored as either BSON arrays or objects.
         */
        $e = explode('.', $fieldName, 4);

        // No further processing for unmapped fields
        if (! isset($class->fieldMappings[$e[0]])) {
            return [[$fieldName, $value]];
        }

        $mapping = $class->fieldMappings[$e[0]];
        $e[0]    = $mapping['name'];

        // Hash and raw fields will not be prepared beyond the field name
        if ($mapping['type'] === Type::HASH || $mapping['type'] === Type::RAW) {
            $fieldName = implode('.', $e);

            return [[$fieldName, $value]];
        }

        if ($mapping['type'] === 'many' && CollectionHelper::isHash($mapping['strategy'])
                && isset($e[2])) {
            $objectProperty       = $e[2];
            $objectPropertyPrefix = $e[1] . '.';
            $nextObjectProperty   = implode('.', array_slice($e, 3));
        } elseif ($e[1] !== '$') {
            $fieldName            = $e[0] . '.' . $e[1];
            $objectProperty       = $e[1];
            $objectPropertyPrefix = '';
            $nextObjectProperty   = implode('.', array_slice($e, 2));
        } elseif (isset($e[2])) {
            $fieldName            = $e[0] . '.' . $e[1] . '.' . $e[2];
            $objectProperty       = $e[2];
            $objectPropertyPrefix = $e[1] . '.';
            $nextObjectProperty   = implode('.', array_slice($e, 3));
        } else {
            $fieldName = $e[0] . '.' . $e[1];

            return [[$fieldName, $value]];
        }

        // No further processing for fields without a targetDocument mapping
        if (! isset($mapping['targetDocument'])) {
            if ($nextObjectProperty) {
                $fieldName .= '.' . $nextObjectProperty;
            }

            return [[$fieldName, $value]];
        }

        $targetClass = $this->dm->getClassMetadata($mapping['targetDocument']);

        // No further processing for unmapped targetDocument fields
        if (! $targetClass->hasField($objectProperty)) {
            if ($nextObjectProperty) {
                $fieldName .= '.' . $nextObjectProperty;
            }

            return [[$fieldName, $value]];
        }

        $targetMapping      = $targetClass->getFieldMapping($objectProperty);
        $objectPropertyIsId = $targetClass->isIdentifier($objectProperty);

        // Prepare DBRef identifiers or the mapped field's property path
        $fieldName = $objectPropertyIsId && ! empty($mapping['reference']) && $mapping['storeAs'] !== ClassMetadata::REFERENCE_STORE_AS_ID
            ? ClassMetadata::getReferenceFieldName($mapping['storeAs'], $e[0])
            : $e[0] . '.' . $objectPropertyPrefix . $targetMapping['name'];

        // Process targetDocument identifier fields
        if ($objectPropertyIsId) {
            if (! $prepareValue) {
                return [[$fieldName, $value]];
            }

            if (! is_array($value)) {
                return [[$fieldName, $targetClass->getDatabaseIdentifierValue($value)]];
            }

            // Objects without operators or with DBRef fields can be converted immediately
            if (! $this->hasQueryOperators($value) || $this->hasDBRefFields($value)) {
                return [[$fieldName, $targetClass->getDatabaseIdentifierValue($value)]];
            }

            return [[$fieldName, $this->prepareQueryExpression($value, $targetClass)]];
        }

        /* The property path may include a third field segment, excluding the
         * collection item pointer. If present, this next object property must
         * be processed recursively.
         */
        if ($nextObjectProperty) {
            // Respect the targetDocument's class metadata when recursing
            $nextTargetClass = isset($targetMapping['targetDocument'])
                ? $this->dm->getClassMetadata($targetMapping['targetDocument'])
                : null;

            if (empty($targetMapping['reference'])) {
                $fieldNames = $this->prepareQueryElement($nextObjectProperty, $value, $nextTargetClass, $prepareValue);
            } else {
                // No recursive processing for references as most probably somebody is querying DBRef or alike
                if ($nextObjectProperty[0] !== '$' && in_array($targetMapping['storeAs'], [ClassMetadata::REFERENCE_STORE_AS_DB_REF_WITH_DB, ClassMetadata::REFERENCE_STORE_AS_DB_REF])) {
                    $nextObjectProperty = '$' . $nextObjectProperty;
                }
                $fieldNames = [[$nextObjectProperty, $value]];
            }

            return array_map(static function ($preparedTuple) use ($fieldName) {
                [$key, $value] = $preparedTuple;

                return [$fieldName . '.' . $key, $value];
            }, $fieldNames);
        }

        return [[$fieldName, $value]];
    }
533456
public function execute($content, $data = [])
    {

        //return $content;
        $this->loader->addData($data);

        $tpl = new DOMDocument();

        $tpl->resolveExternals = true;
        $tpl->preserveWhiteSpace = false;

        //libxml_use_internal_errors(true);
        $tpl->loadXML($content, LIBXML_COMPACT & LIBXML_NOBLANKS & LIBXML_DTDATTR);
        //$this->masterName = $tpl->documentElement->attributes->getNamedItem("name")->nodeValue;
        $this->xPath = new DOMXPath($tpl);

        $this->walk($tpl, $data);

        //It is not ideal to removeNodes from the Remove Queue whilst we walk over it, therefore,
        //Some nodes might need to be removed after iteration;
        return "<!DOCTYPE html>\n".trim($tpl->saveHTML());
    }
944195
private function arrayToObject(array $data, FieldsAwareDefinitionInterface $definition)
    {
        $class = null;
        if ($definition instanceof ClassAwareDefinitionInterface) {
            $class = $definition->getClass();
        }

        //normalize data
        foreach ($data as $fieldName => &$value) {
            if (!$definition->hasField($fieldName)) {
                continue;
            }
            $fieldDefinition = $definition->getField($fieldName);
            $value = $this->normalizeValue($value, $fieldDefinition->getType());
        }
        unset($value);

        //instantiate object
        if (class_exists($class)) {
            $object = new $class();
        } else {
            $object = $data;
        }

        //populate object
        foreach ($data as $key => $value) {
            if (!$definition->hasField($key)) {
                continue;
            }
            $fieldDefinition = $definition->getField($key);

            if (\is_array($value) && $this->endpoint->hasType($fieldDefinition->getType())) {
                $childType = $this->endpoint->getType($fieldDefinition->getType());
                if ($childType instanceof FieldsAwareDefinitionInterface) {
                    $value = $this->arrayToObject($value, $childType);
                }
            }

            $this->setObjectValue($object, $fieldDefinition, $value);
        }

        return $object;
    }
341952
public static function fromOwner( $owner, $provider, $dataPool )
	{
		$result = new ExprIterator();
		$result->nodes = $owner->toArray();
		$result->provider = $provider;
		$result->dataPool = $dataPool;
		return $result;
	}