Handle on meta received

@param array $metaData The meta data

@return array New meta data
338744
protected function onMetaReceived($metaData)
    {
        foreach ($this->groupColumns as $column) {
            $metaData["columns"][$column]["method"] = "group";
        }
        foreach ($this->sumColumns as $column) {

            $metaData["columns"][$column]["method"] = "sum";
        }
        foreach ($this->countColumns as $column) {
            $metaData["columns"][$column]["method"] = "count";
            $metaData["columns"][$column]["type"] = "number";
        }
        foreach ($this->avgColumns as $column) {
            $metaData["columns"][$column]["method"] = "avg";
        }

        foreach ($this->minColumns as $column) {
            $metaData["columns"][$column]["method"] = "min";
        }
        foreach ($this->maxColumns as $column) {
            $metaData["columns"][$column]["method"] = "max";
        }
        return $metaData;
    }
1215483
public function setMeta(array $meta)
    {
        $headers = [];
        $metaType = $this->objectMetaType();

        // We will replace any 'X-{Object}-Meta-' prefixes in meta name
        // and prepend final header names with same prefix so API will
        // receive sanitized headers and won't produce any errors.

        foreach ($meta as $name => $value) {
            $key = str_replace('X-'.$metaType.'-Meta-', '', $name);
            $headers['X-'.$metaType.'-Meta-'.$key] = $value;
        }

        $response = $this->apiClient()->request('POST', $this->absolutePath(), ['headers' => $headers]);

        if ($response->getStatusCode() !== 202) {
            throw new ApiRequestFailedException('Unable to update container meta data.', $response->getStatusCode());
        }

        return true;
    }
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;
    }
1057641
public function updateMetadata(array $metadata)
    {
        $processed = array();

        foreach ($metadata as $k => $v) {
            $processed[strtolower(str_ireplace('X-Container-Meta-', '', $k))] = $v;
        }

        $this->connection->makeRequest(Client::POST, array($this->name), $processed);

        $this->metadata = $processed;
    }
1275780
public function generateMetadataHeaders(array $metadata)
    {
        $metadataHeaders = [];

        if (is_array($metadata) && !is_null($metadata)) {
            foreach ($metadata as $key => $value) {
                $headerName = Resources::X_MS_META_HEADER_PREFIX;
                if (strpos($value, "\r") !== false
                    || strpos($value, "\n") !== false
                ) {
                    throw new \InvalidArgumentException(Resources::INVALID_META_MSG);
                }

                $headerName .= strtolower($key);
                $metadataHeaders[$headerName] = $value;
            }
        }

        return $metadataHeaders;
    }
24239
public function addMetadata(\TechPromux\DynamicQueryBundle\Entity\Metadata $metadata)
    {
        $this->metadatas[] = $metadata;

        return $this;
    }
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;
    }
927386
public function setMeta(array $meta)
    {
        foreach ($meta as $name => $value) {
            if (empty($value)) {
                unset($meta[$name]);
            }
        }

        $this->meta = $meta;

        return $this;
    }
1336365
private function fromArray(array $metadata)
    {
        // @TODO Throw exception if mandatory parameters Attribute & Key are missing !!

        $defaults = array('type' => 'mixed', 'mappedClass' => null);
        $data = array_merge($defaults, $metadata);

        $type = $data['type'];
        $mappedClass = $data['mappedClass'];
        $isSupported = isset(static::$supportedTypes[$type]);

        if ($isSupported && 'composite' === static::$supportedTypes[$type]
         && !empty($mappedClass)) {
            // Embedded collection: type => array, mappedClass => FQDN

            if (!static::isValidNamespace($mappedClass)) {
                throw new \InvalidArgumentException(sprintf('Mapped class "%s" is not a valid FQDN', $mappedClass));
            }

            // Set the mapping type & prepend a \ on the mapped FQDN
            $this->mappedType = Definition::COLLECTION;
            $this->mappedClass = (strpos($mappedClass, '\\') === 0) ? $mappedClass : '\\'.$mappedClass;

        } elseif (!$isSupported) {
            // Embedded document: type => FQDN

            if (!static::isValidNamespace($type)) {
                throw new \InvalidArgumentException(sprintf('User type "%s" is not a valid FQDN', $type));
            }

            // Set the mapping type & prepend a \ on the mapped FQDN
            $this->mappedType = Definition::DOCUMENT;
            $this->mappedClass = $type = (strpos($type, '\\') === 0) ? $type : '\\'.$type;
        }

        $this->type = $type;
        $this->attribute = $data['attribute'];
        $this->key = $data['key'];
        $this->accessor = $data['accessor'];
        $this->mutator = $data['mutator'];
    }
1330579
public function receiveMeta($metaData, $source)
    {
        if ($source === $this->container[0]["source"]) {
            $this->container[0]["meta"] = $metaData;
        } else {
            $this->container[1]["meta"] = $metaData;
        }
        if ($this->container[0]["meta"] && $this->container[1]["meta"]) {
            $meta = array(
                "columns" => array_merge(
                    $this->container[0]["meta"]["columns"],
                    $this->container[1]["meta"]["columns"]
                ),
            );
            $this->sendMeta($meta);
        }
    }
341851
public function onFailure($metadata)
    {
        $this->completed = true;
        $e = new MessageFailureException($metadata->getElements()['message']);
        $e->setStatusCode($metadata->getElements()['code']);

        throw $e;
    }
458572
protected function parseMetadata(array $metadata): void
    {
        if (isset($metadata['arrayGroups'])) {
            foreach ($metadata['arrayGroups'] as $name => $values) {
                if (!isset($this->arrayGroups[$name])) {
                    $this->arrayGroups[$name] = array();
                }
                
                foreach ($values as $locale => $keyName) {
                    $this->arrayGroups[$name][$locale] = $keyName;
                }
            }
        }
    }
882005
protected function onMetaReceived($metaData)
    {
        if (is_array($this->params)) {
            foreach ($this->params as $columnName => $columnInfo) {
                if (isset($metaData["columns"][$columnName])) {
                    $newColumnName = Utility::get($columnInfo, "name");
                    $currentColumnInfo = $metaData["columns"][$columnName];
                    if ($newColumnName) {
                        unset($columnInfo["name"]);
                        unset($metaData["columns"][$columnName]);
                    }

                    if ($this->override) {
                        $metaData["columns"][($newColumnName) ? $newColumnName : $columnName] = $columnInfo;
                    } else {
                        $metaData["columns"][($newColumnName) ? $newColumnName : $columnName] = array_merge($currentColumnInfo, $columnInfo);
                    }
                }
            }
        } else if (is_callable($this->params)) {
            $func = $this->params;
            $columns = $metaData['columns'];
            $pos = 0;
            foreach ($columns as $c => $cMeta) {
                $newMeta = $func($c, $cMeta, $pos);
                if (isset($newMeta['name'])) {
                    $newName = $newMeta['name'];
                    $this->nameMap[$c] = $newName;
                    // unset($columns[$c]);
                    unset($newMeta['name']);
                    $columns[$newName] = $newMeta;
                } else {
                    $columns[$c] = $newMeta;
                }
                $pos++;
            }
            $metaData['columns'] = $columns;
        }
        return $metaData;
    }
225839
private function setMetadata(array $metadata)
    {
        foreach($metadata as $key => &$partial) {
            $this->assertArrayOrScalar($partial, $key);
        }

        $this->metadata = new ArrayReader($metadata);
    }
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;
	}
993532
public function receiveMeta($metaData,$source)
    {
        $this->streamingSource = $source;
        $this->metaData = $metaData;
        $this->startProcess->receiveMeta($metaData, $this);
    }
798979
public function getMeta($meta = null)
  {
    if ($meta === null) {
      return $this->meta;
    }

    return $this->meta->get($meta);
  }