Returns the content as an array with all the provided members of the error document. You can also pass
additional meta information for the document in the $additionalMeta argument.
776255
private function transformErrors(ErrorDocumentTransformation $transformation): void
    {
        foreach ($transformation->document->getErrors() as $error) {
            $transformation->result["errors"][] = $error->transform();
        }
    }
504549
protected function collectMetaDataFromPage()
    {
        // #################
        // Page meta
        // #################

        // description
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['description_page'],
            $this->tsSetupSeo['conf.']['description_page.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['description'] = $tmp;
        }

        // keywords
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['keywords_page'],
            $this->tsSetupSeo['conf.']['keywords_page.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['keywords'] = $tmp;
        }

        // title
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['title_page'],
            $this->tsSetupSeo['conf.']['title_page.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['title'] = $tmp;
        }

        // author
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['author_page'],
            $this->tsSetupSeo['conf.']['author_page.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['author'] = $tmp;
        }

        // email
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['email_page'],
            $this->tsSetupSeo['conf.']['email_page.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['email'] = $tmp;
        }

        // last-update
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['lastUpdate_page'],
            $this->tsSetupSeo['conf.']['lastUpdate_page.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['lastUpdate'] = $tmp;
        }

        // #################
        // Geo
        // #################

        // tx_metaseo_geo_lat
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['tx_metaseo_geo_lat'],
            $this->tsSetupSeo['conf.']['tx_metaseo_geo_lat.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['geoPositionLatitude'] = $tmp;
        }

        // tx_metaseo_geo_long
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['tx_metaseo_geo_long'],
            $this->tsSetupSeo['conf.']['tx_metaseo_geo_long.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['geoPositionLongitude'] = $tmp;
        }

        // tx_metaseo_geo_place
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['tx_metaseo_geo_place'],
            $this->tsSetupSeo['conf.']['tx_metaseo_geo_place.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['geoPlacename'] = $tmp;
        }

        // tx_metaseo_geo_region
        $tmp = $this->cObj->stdWrap(
            $this->tsSetupSeo['conf.']['tx_metaseo_geo_region'],
            $this->tsSetupSeo['conf.']['tx_metaseo_geo_region.']
        );
        if (!empty($tmp)) {
            $this->pageMeta['geoRegion'] = $tmp;
        }

        // #################
        // Process meta tags
        // #################

        // process page meta data
        foreach ($this->pageMeta as $metaKey => $metaValue) {
            $metaValue = trim($metaValue);

            if (!empty($metaValue)) {
                $this->tsSetupSeo[$metaKey] = $metaValue;
            }
        }
    }
61030
private function fetchAllErrorDescription(array $errorArray): array
    {
        $allErrorDescription = [];

        foreach ($errorArray[self::FIELD_ERROR] as $error) {
            $description = $error[self::FIELD_ERROR_DESCRIPTION];
            $allErrorDescription[] = $description;
        }

        return $allErrorDescription;
    }
220876
public function toArray()
    {
        $content = [
            'id' => $this->content->id,
            '_content' => $this->content->toArray(),
            '_revision' => $this->revision->toArray(),
        ];

        foreach ($this->data as $field => $data) {
            $content[$field] = $data->toArray();
        }

        return $content;
    }
1096608
public function metaDescription()
    {
        $context = $this->contextObject();

        $desc = null;
        if ($context instanceof HasMetatagInterface) {
            $desc = (string)$context['meta_description'];
        }

        if (!$desc) {
            $desc = (string)$this->fallbackMetaDescription();
        }

        return $desc;
    }
68779
public function toArray() : array
    {
        $result = [];

        if (!empty($this->id)) {
            $result['id'] = $this->id;
        }

        if (!empty($this->link)) {
            $result['links']['about'] = $this->link;
        }

        if (!empty($this->status)) {
            $result['status'] = "{$this->status}";
        }

        if (!empty($this->code)) {
            $result['code'] = "{$this->code}";
        }

        if (!empty($this->title)) {
            $result['title'] = $this->title;
        }

        if (!empty($this->detail)) {
            $result['detail'] = $this->detail;
        }

        if (!empty($this->source)) {
            $result['source'] = $this->source->map(function ($item) {
                return $item;
            });
        }

        if (!empty($this->meta)) {
            $result['meta'] = $this->meta;
        }

        if (!empty($this->exception)) {
            $e = $this->exception;
            if ($e instanceof ExtendedLoggingInformation) {
                $result['exception'] = $e->context();
            } else {
                $result['exception'] = [
                    'exception' => get_class($e),
                    'message' => $e->getMessage(),
                    'stacktrace' => $e->getTrace(),
                ];
            }
        }

        return $result;
    }
817820
function ssetMeta($name = '', $content = '', $type = 'name', $newline = "\n\t")
	{
		// Since we allow the data to be passes as a string, a simple array
		// or a multidimensional one, we need to do a little prepping.
		if ( ! is_array($name))
		{
			$name = array(array('name' => $name, 'content' => $content, 'type' => $type, 'newline' => $newline));
		}
		elseif (isset($name['name']))
		{
			// Turn single array into multidimensional
			$name = array($name);
		}

		$str = '';
		foreach ($name as $meta)
		{
			$type		= ( ! isset($meta['type']) OR $meta['type'] === 'name') ? 'name' : 'http-equiv';
			$name		= isset($meta['name'])					? $meta['name'] : '';
			$content	= isset($meta['content'])				? $meta['content'] : '';
			$newline	= isset($meta['newline'])				? $meta['newline'] : "\n";

			$str .= '<meta '.$type.'="'.$name.'" content="'.$content.'" />'.$newline;
		}

		$this->_metadata .= $str;
	}
673561
public function getErrorMetadata()
	{
		try
		{
			$metadata = \Sifo\Config::getInstance()->getConfig( 'lang/metadata_' . $this->getParam( 'lang' ) );
		}
		catch ( Exception_Configuration $e )
		{
			$metadata = \Sifo\Config::getInstance()->getConfig( 'lang/metadata_en_US' );
		}

		$error_code = $this->getParam( 'code' );

		return ( isset( $metadata[$error_code] ) ) ? $metadata[$error_code] : false;
	}
999104
public Object[][] getContents() {
        Object[][] contents = new Object[][] {
            {   MsgKey.BAD_MSGKEY,
                "A chave de mensagem ''{0}'' n\u00e3o est\u00e1 na classe de mensagem ''{1}''" },

            {   MsgKey.BAD_MSGFORMAT,
                "O formato da mensagem ''{0}'' na classe de mensagem ''{1}'' falhou." },

            {   MsgKey.ER_SERIALIZER_NOT_CONTENTHANDLER,
                "A classe de serializador ''{0}'' n\u00e3o implementa org.xml.sax.ContentHandler." },

            {   MsgKey.ER_RESOURCE_COULD_NOT_FIND,
                    "O recurso [ {0} ] n\u00e3o p\u00f4de ser encontrado.\n{1}" },

            {   MsgKey.ER_RESOURCE_COULD_NOT_LOAD,
                    "O recurso [ {0} ] n\u00e3o p\u00f4de carregar: {1} \n {2} \t {3}" },

            {   MsgKey.ER_BUFFER_SIZE_LESSTHAN_ZERO,
                    "Tamanho do buffer <=0" },

            {   MsgKey.ER_INVALID_UTF16_SURROGATE,
                    "Detectado substituto UTF-16 inv\u00e1lido: {0} ?" },

            {   MsgKey.ER_OIERROR,
                "Erro de E/S" },

            {   MsgKey.ER_ILLEGAL_ATTRIBUTE_POSITION,
                "Imposs\u00edvel incluir atributo {0} depois de n\u00f3s filhos ou antes da gera\u00e7\u00e3o de um elemento. O atributo ser\u00e1 ignorado." },

            /*
             * Note to translators:  The stylesheet contained a reference to a
             * namespace prefix that was undefined.  The value of the substitution
             * text is the name of the prefix.
             */
            {   MsgKey.ER_NAMESPACE_PREFIX,
                "O espa\u00e7o de nomes do prefixo ''{0}'' n\u00e3o foi declarado. " },

            /*
             * Note to translators:  This message is reported if the stylesheet
             * being processed attempted to construct an XML document with an
             * attribute in a place other than on an element.  The substitution text
             * specifies the name of the attribute.
             */
            {   MsgKey.ER_STRAY_ATTRIBUTE,
                "Atributo ''{0}'' fora do elemento. " },

            /*
             * Note to translators:  As with the preceding message, a namespace
             * declaration has the form of an attribute and is only permitted to
             * appear on an element.  The substitution text {0} is the namespace
             * prefix and {1} is the URI that was being used in the erroneous
             * namespace declaration.
             */
            {   MsgKey.ER_STRAY_NAMESPACE,
                "Declara\u00e7\u00e3o de espa\u00e7o de nomes ''{0}''=''{1}'' fora do elemento. " },

            {   MsgKey.ER_COULD_NOT_LOAD_RESOURCE,
                "N\u00e3o foi poss\u00edvel carregar ''{0}'' (verifique CLASSPATH) agora , utilizando somente os padr\u00f5es" },

            {   MsgKey.ER_ILLEGAL_CHARACTER,
                "Tentativa de processar o caractere de um valor integral {0} que n\u00e3o \u00e9 representado na codifica\u00e7\u00e3o de sa\u00edda especificada de {1}." },

            {   MsgKey.ER_COULD_NOT_LOAD_METHOD_PROPERTY,
                "N\u00e3o foi poss\u00edvel carregar o arquivo de propriedade ''{0}'' para o m\u00e9todo de sa\u00edda ''{1}'' (verifique CLASSPATH)" },

            {   MsgKey.ER_INVALID_PORT,
                "N\u00famero de porta inv\u00e1lido" },

            {   MsgKey.ER_PORT_WHEN_HOST_NULL,
                "A porta n\u00e3o pode ser definida quando o host \u00e9 nulo" },

            {   MsgKey.ER_HOST_ADDRESS_NOT_WELLFORMED,
                "O host n\u00e3o \u00e9 um endere\u00e7o formado corretamente" },

            {   MsgKey.ER_SCHEME_NOT_CONFORMANT,
                "O esquema n\u00e3o est\u00e1 em conformidade." },

            {   MsgKey.ER_SCHEME_FROM_NULL_STRING,
                "Imposs\u00edvel definir esquema a partir da cadeia nula" },

            {   MsgKey.ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE,
                "O caminho cont\u00e9m seq\u00fc\u00eancia de escape inv\u00e1lida" },

            {   MsgKey.ER_PATH_INVALID_CHAR,
                "O caminho cont\u00e9m caractere inv\u00e1lido: {0}" },

            {   MsgKey.ER_FRAG_INVALID_CHAR,
                "O fragmento cont\u00e9m caractere inv\u00e1lido" },

            {   MsgKey.ER_FRAG_WHEN_PATH_NULL,
                "O fragmento n\u00e3o pode ser definido quando o caminho \u00e9 nulo" },

            {   MsgKey.ER_FRAG_FOR_GENERIC_URI,
                "O fragmento s\u00f3 pode ser definido para um URI gen\u00e9rico" },

            {   MsgKey.ER_NO_SCHEME_IN_URI,
                "Nenhum esquema encontrado no URI" },

            {   MsgKey.ER_CANNOT_INIT_URI_EMPTY_PARMS,
                "Imposs\u00edvel inicializar URI com par\u00e2metros vazios" },

            {   MsgKey.ER_NO_FRAGMENT_STRING_IN_PATH,
                "O fragmento n\u00e3o pode ser especificado no caminho e fragmento" },

            {   MsgKey.ER_NO_QUERY_STRING_IN_PATH,
                "A cadeia de consulta n\u00e3o pode ser especificada na cadeia de consulta e caminho" },

            {   MsgKey.ER_NO_PORT_IF_NO_HOST,
                "Port n\u00e3o pode ser especificado se host n\u00e3o for especificado" },

            {   MsgKey.ER_NO_USERINFO_IF_NO_HOST,
                "Userinfo n\u00e3o pode ser especificado se host n\u00e3o for especificado" },
            {   MsgKey.ER_XML_VERSION_NOT_SUPPORTED,
                "Aviso:  A vers\u00e3o do documento de sa\u00edda precisa ser ''{0}''.  Essa vers\u00e3o do XML n\u00e3o \u00e9 suportada. A vers\u00e3o do documento de sa\u00edda ser\u00e1 ''1.0''." },

            {   MsgKey.ER_SCHEME_REQUIRED,
                "O esquema \u00e9 obrigat\u00f3rio!" },

            /*
             * Note to translators:  The words 'Properties' and
             * 'SerializerFactory' in this message are Java class names
             * and should not be translated.
             */
            {   MsgKey.ER_FACTORY_PROPERTY_MISSING,
                "O objeto Properties transmitido para SerializerFactory n\u00e3o tem uma propriedade ''{0}''." },

            {   MsgKey.ER_ENCODING_NOT_SUPPORTED,
                "Aviso:  A codifica\u00e7\u00e3o ''{0}'' n\u00e3o \u00e9 suportada pelo Java Runtime." },

             {MsgKey.ER_FEATURE_NOT_FOUND,
             "O par\u00e2metro ''{0}'' n\u00e3o \u00e9 reconhecido."},

             {MsgKey.ER_FEATURE_NOT_SUPPORTED,
             "O par\u00e2metro ''{0}'' \u00e9 reconhecido, mas o valor pedido n\u00e3o pode ser definido. "},

             {MsgKey.ER_STRING_TOO_LONG,
             "A cadeia resultante \u00e9 muito longa para caber em uma DOMString: ''{0}''. "},

             {MsgKey.ER_TYPE_MISMATCH_ERR,
             "O tipo de valor para este nome de par\u00e2metro \u00e9 incompat\u00edvel com o tipo de valor esperado. "},

             {MsgKey.ER_NO_OUTPUT_SPECIFIED,
             "O destino de sa\u00edda para os dados a serem gravados era nulo. "},

             {MsgKey.ER_UNSUPPORTED_ENCODING,
             "Uma codifica\u00e7\u00e3o n\u00e3o suportada foi encontrada. "},

             {MsgKey.ER_UNABLE_TO_SERIALIZE_NODE,
             "O n\u00f3 n\u00e3o p\u00f4de ser serializado."},

             {MsgKey.ER_CDATA_SECTIONS_SPLIT,
             "A Se\u00e7\u00e3o CDATA cont\u00e9m um ou mais marcadores de t\u00e9rmino ']]>'."},

             {MsgKey.ER_WARNING_WF_NOT_CHECKED,
                 "Uma inst\u00e2ncia do verificador Well-Formedness n\u00e3o p\u00f4de ser criada. O par\u00e2metro well-formed foi definido como true, mas a verifica\u00e7\u00e3o well-formedness n\u00e3o pode ser executada."
             },

             {MsgKey.ER_WF_INVALID_CHARACTER,
                 "O n\u00f3 ''{0}'' cont\u00e9m caracteres XML inv\u00e1lidos. "
             },

             { MsgKey.ER_WF_INVALID_CHARACTER_IN_COMMENT,
                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no coment\u00e1rio. "
             },

             { MsgKey.ER_WF_INVALID_CHARACTER_IN_PI,
                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no processo instructiondata."
             },

             { MsgKey.ER_WF_INVALID_CHARACTER_IN_CDATA,
                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado nos conte\u00fados do CDATASection. "
             },

             { MsgKey.ER_WF_INVALID_CHARACTER_IN_TEXT,
                 "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no conte\u00fado dos dados de caractere dos n\u00f3s. "
             },

             { MsgKey.ER_WF_INVALID_CHARACTER_IN_NODE_NAME,
                 "Um caractere inv\u00e1lido foi encontrado no {0} do n\u00f3 denominado ''{1}''."
             },

             { MsgKey.ER_WF_DASH_IN_COMMENT,
                 "A cadeia \"--\" n\u00e3o \u00e9 permitida dentro dos coment\u00e1rios. "
             },

             {MsgKey.ER_WF_LT_IN_ATTVAL,
                 "O valor do atributo \"{1}\" associado a um tipo de elemento \"{0}\" n\u00e3o deve conter o caractere ''<''. "
             },

             {MsgKey.ER_WF_REF_TO_UNPARSED_ENT,
                 "A refer\u00eancia de entidade n\u00e3o analisada \"&{0};\" n\u00e3o \u00e9 permitida. "
             },

             {MsgKey.ER_WF_REF_TO_EXTERNAL_ENT,
                 "A refer\u00eancia de entidade externa \"&{0};\" n\u00e3o \u00e9 permitida em um valor de atributo. "
             },

             {MsgKey.ER_NS_PREFIX_CANNOT_BE_BOUND,
                 "O prefixo \"{0}\" n\u00e3o pode ser vinculado ao espa\u00e7o de nomes \"{1}\"."
             },

             {MsgKey.ER_NULL_LOCAL_ELEMENT_NAME,
                 "O nome local do elemento \"{0}\" \u00e9 nulo."
             },

             {MsgKey.ER_NULL_LOCAL_ATTR_NAME,
                 "O nome local do atributo \"{0}\" \u00e9 nulo."
             },

             { MsgKey.ER_ELEM_UNBOUND_PREFIX_IN_ENTREF,
                 "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de elemento \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"."
             },

             { MsgKey.ER_ATTR_UNBOUND_PREFIX_IN_ENTREF,
                 "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de atributo \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"."
             },

        };

        return contents;
    }
237176
public function mentionedMembers() {
		$members = array();
		if (preg_match_all('/@(.*?):(\d+)/', $this->Content, $matches)) {
			foreach ($matches[2] as $match) {
				$member = Member::get()->byID((int) $match);
				if ($member && $member->ID) {
					$members[] = $member;
				}
			}
		}
		return $members;
	}
262724
public function errorArray()
    {
        $messages = [];
        foreach ($this->failures as $key => $rule) {
            foreach ($rule->getFailures() as $fail) {
                $messages[] = $fail;
            }
        }
        return $messages;
    }
402571
def errors(self):
        
        if self.ok():
            return {}

        errors = self.content

        if(not isinstance(errors, dict)):
            errors = {"error": errors}  # convert to dict for consistency
        elif('errors' in errors):
            errors = errors['errors']

        return errors
158132
private String parseMetadata(DocumentMetadata metadata) throws IOException {
        ResultItem item = result.next();
        String uri = item.asString();
        if (uri == null) {
            throw new IOException("Missing document URI for metadata.");
        }
        item = result.next();
        //node-kind, must exist
        String nKind = item.asString();
        metadata.setFormat(nKind);
        
        item = result.next();
        // handle collections, may not be present
        while (item != null && item.getItemType() == ValueType.XS_STRING) {
            if (!copyCollection) {
                item = result.next();
                continue;
            }
            metadata.addCollection(item.asString());
            item = result.next();
        }
        
        // handle permissions, may not be present
        StringBuilder buf = new StringBuilder();
        buf.append("<perms>");
        while (item != null && ValueType.ELEMENT == item.getItemType()) {
            if (!copyPermission) {
                item = result.next();
                continue;
            }
            try {
                readPermission((XdmElement) item.getItem(), metadata, buf);
            } catch (Exception e) {
                throw new IOException(e);
            }
            item = result.next();
        }
        buf.append("</perms>");
        metadata.setPermString(buf.toString());
        
        // handle quality, always present even if not requested (barrier)
        metadata.setQuality((XSInteger) item.getItem());
        
        // handle metadata
        item = result.next();
        if (copyMetadata) {
            XdmItem metaItem  = item.getItem();
            if (metaItem instanceof JsonItem) {
                JsonNode node = ((JsonItem)metaItem).asJsonNode();
                metadata.meta = new HashMap<String, String>(node.size());
                for (Iterator<String> names = node.fieldNames(); 
                     names.hasNext();) {
                    String key = names.next();
                    JsonNode nodeVal = node.get(key);
                    metadata.meta.put(key, nodeVal.asText());
                }
                item = result.next();
            }
        }

        // handle prop:properties node, optional
        // if not present, there will be a 0 as a marker
    
        if (copyProperties && ValueType.ELEMENT == item.getItemType()) {
            String pString = item.asString();
            if (pString != null) {
                metadata.setProperties(pString);
            }
            item = result.next();
        }
        if (ValueType.XS_INTEGER != item.getItemType()) {
            throw new IOException(uri + " unexpected " + item.getItemType() + " "
                + item.asString() + ", expected " + ValueType.XS_INTEGER
                + " 0");
        }
        return uri;
    }
561174
public function asArray()
    {
        $error = $this->error;
        if ($error->has()) {
            $o = [
                'error' => true,
                'errors' => [],
                'htmlErrorIndexes' => [],
            ];
            $index = 0;
            foreach ($error->getList() as $error) {
                $o['errors'][] = (string) $error;
                if ($error instanceof HtmlAwareErrorInterface && $error->messageContainsHtml()) {
                    $o['htmlErrorIndexes'][] = $index;
                }
                ++$index;
            }
            if (empty($o['htmlErrorIndexes'])) {
                unset($o['htmlErrorIndexes']);
            }

            return $o;
        }
    }
105018
public function getMeta()
    {
        $arrReturn = [];
        if (null !== $this->entity->getMeta()) {
            foreach ($this->entity->getMeta() as $meta) {
                if (!$meta->getLocale() || $meta->getLocale() === $this->locale) {
                    array_push(
                        $arrReturn,
                        [
                            'id' => $meta->getId(),
                            'key' => $meta->getKey(),
                            'value' => $meta->getValue(),
                        ]
                    );
                }
            }

            return $arrReturn;
        }

        return;
    }
640163
public function getContents()
    {
        $contents = file_get_contents($this->getPath());

        foreach ($this->getReplaces() as $search => $replace) {
            $contents = str_replace('$'.strtoupper($search).'$', $replace, $contents);
        }

        return $contents;
    }
211708
private function getErrorMessages(array $errors)
    {
        $content = [];
        foreach ($errors as $error) {
            $property = $error->getProperty();
            if ($property instanceof JsonPointer && $this->constraintUtils instanceof ConstraintUtils) {
                $property = $this->constraintUtils->getNormalizedPathFromPointer($property);
            }
            $content[] = [
                'propertyPath' => $property,
                'message' => $error->getMessage(),
            ];
        }
        return $content;
    }