@param Metadata $metadata

@return array
7276
protected function prepareForSending(Metadata $metadata)
	{
		$this->calculateGroupingHash($metadata);
		$metadataArr = array_merge($metadata->getTags(), $metadata->getMetadata());

		$this->setReleaseStage($metadata->getStage());
		$this->setProjectRoot($metadata->getAppRootDir());
		$this->setAppVersion($metadata->getAppVersion());

		return $metadataArr;
	}
1298710
protected function convertKeys(array $meta) {
        $return = [];
        foreach ($meta as $key => $value) {
            if (is_array($value)) {
                $value = $this->convertKeys($value);
            }
            $newKey = strtolower($key);
            $newKey = preg_replace('/[^\w+]/', '_', $newKey);
            $return[$newKey] = $value;
        }
        return $return;
    }
474131
private function getFieldsFromEntityMetadata(ClassMetadataInfo $metadata)
    {
        $fields = (array) $metadata->fieldNames;

        // Remove the primary key field if it's not managed manually
        if (!$metadata->isIdentifierNatural()) {
            $fields = array_diff($fields, $metadata->identifier);
        }

        return $fields;
    }
198336
public static function decodeMetadata($metadata)
    {
        if (is_null($metadata) || count($metadata) == 0) {
            return [];
        }
        $result = [];
        foreach ($metadata as $key => $values) {
            foreach ($values as $value) {
                $decodedValue = [
                    '@type' => $key,
                ];
                if (self::hasBinaryHeaderSuffix($key)) {
                    if (isset(self::$metadataKnownTypes[$key])) {
                        $class = self::$metadataKnownTypes[$key];
                        /** @var Message $message */
                        $message = new $class();
                        try {
                            $message->mergeFromString($value);
                            $decodedValue += self::serializeToPhpArray($message);
                        } catch (\Exception $e) {
                            // We encountered an error trying to deserialize the data
                            $decodedValue += [
                                'data' => '<Unable to deserialize data>',
                            ];
                        }
                    } else {
                        // The metadata contains an unexpected binary type
                        $decodedValue += [
                            'data' => '<Unknown Binary Data>',
                        ];
                    }
                } else {
                    $decodedValue += [
                        'data' => $value,
                    ];
                }
                $result[] = $decodedValue;
            }
        }
        return $result;
    }
1350649
protected function encodeMetaToArray($meta): array
    {
        $this->withMeta($meta);

        $writer = $this->getFactory()->createDocumentWriter();

        $writer->setUrlPrefix($this->getUrlPrefix());

        // write header
        $this->writeHeader($writer);

        // write footer
        $this->writeFooter($writer);

        // encode to json
        $array = $writer->getDocument();

        return $array;
    }
976834
private function getFieldsDataFromMetadata(ClassMetadataInfo $metadata)
    {
        $fieldsData = (array) $metadata->fieldMappings;
        $fieldsResult = array();
        // Convert type to filter widget
        foreach ($fieldsData as $fieldName => $data) {
            $fieldWidget = $this->getFilterType($fieldsData[$fieldName]['type']);
            if ($fieldWidget!== false) {
                $fieldsResult[$fieldName]['fieldName'] = $fieldName;
                $fieldsResult[$fieldName]['filterWidget'] = $this->getFilterType($fieldsData[$fieldName]['type'], $fieldName);
            }
        }

        return $fieldsResult;
    }
178055
protected function onMetaReceived($metaData)
    {
        foreach ($this->params as $cName => $cParams) {
            $from = Utility::get($cParams, "from");
            if (!$from) {
                $from = Utility::get(
                    $metaData["columns"][$cName],
                    "format",
                    "Y-m-d H:i:s"
                );
            }
            $to = Utility::get($cParams, "to", "Y-m-d H:i:s");

            $this->params[$cName] = array(
                "from" => $from,
                "to" => $to,
            );
            $metaData["columns"][$cName] = array_merge(
                $metaData["columns"][$cName],
                array(
                    "type" => "datetime",
                    "format" => $to,
                )
            );
        }
        return $metaData;
    }
785081
private function loadSearchMetadata(EntityMetadata $metadata)
    {
        if (false === $metadata->isSearchEnabled()) {
            return $metadata;
        }
        $clientKey = $metadata->search->getKey();
        $searchFactory = $this->driver->getSearchMetadataFactory($clientKey);

        $searchFactory->handleLoad($metadata);
        $searchFactory->handleValidate($metadata);
        return $metadata;
    }
574298
protected function getMetaDoc($meta)
    {
        if ($meta instanceof \Couchbase\Document) {
            return $meta->value;
        }
        if (is_array($meta)) {
            $result = [];
            foreach ($meta as $row) {
                $result[] = $this->getMetaDoc($row);
            }

            return $result;
        }

        return null;
    }
1053680
public function loadClassMetadata(Mapping\ClassMetadataInterface $metadata)
    {
        
        $reflClass = $metadata->getReflectionClass();
        
        //Iterate over properties to get annotations
        foreach($reflClass->getProperties() as $property) {
            
            $this->readProperty($property, $metadata);
            
        }
        
    }
81565
public function getMetadata(Metadata $metadata = null, \Exception $exception = null)
	{
		$metadata = isset($metadata) ? $metadata : new Metadata();

		if (!$metadata->getSeverity())
		{
			if ($exception instanceof ErrorException)
			{
				$metadata->setSeverity($exception->getSeverity());
			}
			elseif ($exception instanceof \Exception)
			{
				$metadata->setSeverity(Severity::ERROR);
			}
			else
			{
				$metadata->setSeverity(Severity::NOTICE);
			}
		}

		foreach ($this->processorManager->all() as $processor)
		{
			$processor->process($metadata, $exception);
		}

		return $metadata;
	}
573008
private function generateDocumentMethods(array $metadata)
    {
        $lines = [];

        foreach ($metadata['properties'] as $property) {
            if (isset($property['visibility']) && $property['visibility'] === 'public') {
                continue;
            }
            $lines[] = $this->generateDocumentMethod($property, $this->setMethodTemplate) . "\n";
            if (isset($property['property_type']) && $property['property_type'] === 'boolean') {
                $lines[] = $this->generateDocumentMethod($property, $this->isMethodTemplate) . "\n";
            }

            $lines[] = $this->generateDocumentMethod($property, $this->getMethodTemplate) . "\n";
        }

        return implode("\n", $lines);
    }
1196111
public function addMetaData(array $metadata)
    {
        $this->metaData = array_replace_recursive($this->metaData, $metadata);
        $this->metaData = $this->removeNullElements($this->metaData);

        return $this;
    }
1256852
protected function castPropertiesMeta(array $meta): array
    {
        $properties = [];
        foreach ($meta['@properties'] ?? [] as $name => $data) {
            $properties[$name] = new MetaProperty($data);
        }

        return $properties;
    }
248298
public function get_meta( $key ) {
		$metadata = $this->get_metadata();

		if ( ! array_key_exists( $key, $metadata ) ) {
			return;
		}

		return $metadata[ $key ];
	}
1355870
public function getMetadataQuery($data, $metadata)
    {
        foreach ($metadata as $searchMetadata) {
            $data[] = $this->setData(['metadata' => $searchMetadata], 'input');
        }

        return $data;
    }
995359
protected function onMetaReceived($metaData)
    {
        $meta = $metaData;
        $meta["columns"] = array();
        foreach ($this->params as $colname) {
            if (isset($metaData["columns"][$colname])) {
                $meta["columns"][$colname] = $metaData["columns"][$colname];
            }
        }
        return $meta;
    }