parseValue example

if ($field instanceof TranslatedField) {
                    foreach ($context->getLanguageIdChain() as $languageId) {
                        $query->add(new ExistsQuery(sprintf('%s.%s', $fieldName$languageId)), BoolQuery::MUST_NOT);
                    }
                } else {
                    $query->add(new ExistsQuery($fieldName), BoolQuery::MUST_NOT);
                }

                return $this->createNestedQuery($query$definition$filter->getField());
            }

            $value = $this->parseValue($definition$filter$filter->getValue());
            $query = new TermQuery($fieldName$value);

            if ($field instanceof TranslatedField) {
                $multiMatchFields = [];

                foreach ($context->getLanguageIdChain() as $languageId) {
                    $multiMatchFields[] = $this->getTranslatedFieldName($fieldName$languageId);
                }

                $query = new MultiMatchQuery($multiMatchFields$value[
                    'type' => 'best_fields',
                ]);
|| self::preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->trimTag($values['value'])$matches)
                        )
                    ) {
                        // this is a compact notation element, add to next block and parse                         $block = $values['value'];
                        if ($this->isNextLineIndented()) {
                            $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['leadspaces']) + 1);
                        }

                        $data[] = $this->parseBlock($this->getRealCurrentLineNb()$block$flags);
                    } else {
                        $data[] = $this->parseValue($values['value']$flags$context);
                    }
                }
                if ($isRef) {
                    $this->refs[$isRef] = end($data);
                    array_pop($this->refsBeingParsed);
                }
            } elseif (
                // @todo in 7.0 remove legacy "(?:!?!php/const:)?"                 self::preg_match('#^(?P<key>(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t)++(?P<value>.+))?$#u', rtrim($this->currentLine)$values)
                && (!str_contains($values['key'], ' #') || \in_array($values['key'][0]['"', "'"]))
            ) {
                
|| self::preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->trimTag($values['value'])$matches)
                        )
                    ) {
                        // this is a compact notation element, add to next block and parse                         $block = $values['value'];
                        if ($this->isNextLineIndented()) {
                            $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + \strlen($values['leadspaces']) + 1);
                        }

                        $data[] = $this->parseBlock($this->getRealCurrentLineNb()$block$flags);
                    } else {
                        $data[] = $this->parseValue($values['value']$flags$context);
                    }
                }
                if ($isRef) {
                    $this->refs[$isRef] = end($data);
                    array_pop($this->refsBeingParsed);
                }
            } elseif (
                // @todo in 7.0 remove legacy "(?:!?!php/const:)?"                 self::preg_match('#^(?P<key>(?:![^\s]++\s++)?(?:'.Inline::REGEX_QUOTED_STRING.'|(?:!?!php/const:)?[^ \'"\[\{!].*?)) *\:(( |\t)++(?P<value>.+))?$#u', rtrim($this->currentLine)$values)
                && (!str_contains($values['key'], ' #') || \in_array($values['key'][0]['"', "'"]))
            ) {
                
Home | Imprint | This part of the site doesn't use cookies.