Handle on meta received

@param array $metaData The meta data

@return array New meta data
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;
    }
248298
public function get_meta( $key ) {
		$metadata = $this->get_metadata();

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

		return $metadata[ $key ];
	}
146949
public function setMetadata(string $metadata): void
    {
        $this->isValidString($metadata, 1000);

        $this->metadata = $metadata;
    }
225839
private function setMetadata(array $metadata)
    {
        foreach($metadata as $key => &$partial) {
            $this->assertArrayOrScalar($partial, $key);
        }

        $this->metadata = new ArrayReader($metadata);
    }
193392
public function updateMetadata($path, array $metadata)
    {
        $url = self::BASE_URI.$this->getPathUnderRootDrive($path);

        return $this->getResponse('PATCH', $url, json_encode($metadata), ['Content-Type' => 'application/json']);
    }
724377
public function setMetaData($metaData) {
		if (is_array($metaData) && empty($metaData)) {
			$this->metaData = new \stdClass;
		} else {
			$this->metaData = $metaData;
		}

		return $this;
	}
1202670
public function addImageMetadata(array $data, array $metadata)
    {
        $data['metadata'] = [];

        foreach ($metadata as $meta_name => $meta_value) {
            $data['metadata'][$meta_name] = $meta_value;
        }

        return $data;
    }
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);
        }
    }
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;
    }
1309815
public static function fromMetadata(string $metadata): ? array
    {
        $values = [];
        $splittedParts = explode('~~', $metadata);

        foreach ($splittedParts as $part) {
            $parts = explode('##', $part);
            if (count($parts) > 1) {
                $values[$parts[0]] = $parts[1];
            } else {
                $values[] = $part;
            }
        }

        if (1 == count($values)) {
            $firstAndUniqueElement = reset($values);
            $values = [
                'id' => $firstAndUniqueElement,
                'name' => $firstAndUniqueElement,
            ];
        }

        if (!array_key_exists('id', $values)) {
            return null;
        }

        return $values;
    }
434048
public function answerWithDataProcessingCompleted(array $metadata = [])
    {
        $type = MessageNameUtils::getTypePartOfMessageName($this->messageName);

        $metadata = ArrayUtils::merge($this->metadata, $metadata);

        return new self(
            $this->payload,
            MessageNameUtils::getDataProcessedEventName($type),
            $this->target, //Previous target is now the origin of the answer
            $this->origin, //Previous origin is now the target of the answer
            $metadata,
            $this->processTaskListPosition,
            $this->version + 1
        );
    }
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;
    }
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;
    }
341851
public function onFailure($metadata)
    {
        $this->completed = true;
        $e = new MessageFailureException($metadata->getElements()['message']);
        $e->setStatusCode($metadata->getElements()['code']);

        throw $e;
    }
5218
private function handleRestoredModelMetas()
	{
		if (!$this->metableTableSoftDeletes()) {
			return;
		}
		
		foreach ($this->metas as $meta) {
			$this->syncMetableTableAttributes();
			$meta->increment('num_items');
		}
	}
44995
public function setMeta($meta)
    {
        foreach($meta as $name => $content)
            $this->getResponse()->getTheme()->addMeta($name, $content);
    }
1212283
protected function loadInterfaceMetadata($metadata)
    {
        foreach( $metadata->getReflectionClass()->getInterfaces() as $interface ) {
            
            $metadata->mergeRules($this->getClassMetadata($interface->getName()));
            
        }
    }