Prepares Meta

@param array $meta
@return array
490438
public function prepareMeta(array $meta)
    {
        $meta = parent::getMeta();

        /** @var ModifierInterface $modifier */
        foreach ($this->pool->getModifiersInstances() as $modifier) {
            $meta = $modifier->modifyMeta($meta);
        }
        return $meta;
    }
208219
protected function onMetaReceived($metaData)
    {
        foreach ($this->params as $cName => $cParam) {
            $metaData["columns"][$cName] = array(
                "type" => "string",
            );
            $this->params[$cName]["formatString"] = Utility::get($cParam, "formatString", "{from} - {to}");
            $this->params[$cName]["decimals"] = Utility::get($cParam, "decimals", 0);
            $this->params[$cName]["thousandSeparator"] = Utility::get($cParam, "thousandSeparator", ",");
            $this->params[$cName]["decimalPoint"] = Utility::get($cParam, "decimalPoint", ".");
            $this->params[$cName]["prefix"] = Utility::get($cParam, "prefix", "");
            $this->params[$cName]["suffix"] = Utility::get($cParam, "suffix", "");
        }
        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);
    }
726843
public function toArray(): array
    {
        $data = [];

        if ($this->hasMetadata()) {
            $data['meta'] = $this->getMetadata();
        }

        if ($this->hasLinks()) {
            $data['links'] = $this->linksToArray();
        }

        return $data;
    }
305396
protected function prepareParams(array $params)
	{
		$prepared = [];
		
		foreach($params as $k => $v)
		{
			if(is_array($v))
			{
				foreach(array_values($v) as $i => $val)
				{
					$prepared[sprintf('%s%u', $k, $i)] = $val;
				}
			}
			else
			{
				$prepared[(string)$k] = $v;
			}
		}
		
		return $prepared;
	}
766709
protected function onMetaReceived($metaData)
    {
        foreach ($this->params as $cKey=>$cValue) {
            unset($cValue["exp"]);
            $metaData["columns"][$cKey] = $cValue;
        }
        return $metaData;
    }
1200470
private function createMetasetConfig(array $metaSets)
    {
        $optionResolver = $this->get('phlexible_meta_set.option_resolver');

        $meta = array();

        foreach ($metaSets as $metaSet) {
            $fieldDatas = [];

            foreach ($metaSet->getFields() as $field) {
                $options = $optionResolver->resolve($field);

                $fieldData = [
                    'key' => $field->getName(),
                    'type' => $field->getType(),
                    'options' => $options,
                    'readonly' => $field->isReadonly(),
                    'required' => $field->isRequired(),
                    'synchronized' => $field->isSynchronized(),
                ];

                $fieldDatas[] = $fieldData;
            }

            $meta[] = [
                'set_id' => $metaSet->getId(),
                'title' => $metaSet->getName(),
                'fields' => $fieldDatas,
            ];
        }

        return $meta;
    }
916480
protected function buildFile(array $meta) : File
    {
        $file = new File($meta['name'], $this->cache);

        if (array_key_exists('offset', $meta)) {
            $file->setMeta($meta['offset'], $meta['size'], $meta['file_path'], $meta['location']);
        }

        return $file;
    }
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;
    }
146629
protected function prepareMetadata(array $category)
    {

        // initialize the metadata
        $metadata = array();

        // query whether or not, the passed category IS the root category
        if ($this->isRootCategory($category)) {
            return;
        }

        // if not, set the category ID in the metadata
        $metadata[UrlRewriteObserver::CATEGORY_ID] = (integer) $category[MemberNames::ENTITY_ID];

        // return the metadata
        return $metadata;
    }
626539
protected function setSeoMetadata(array $metadata)
    {
        if (is_array($this->seoMetadata)) {
            $this->seoMetadata = new ArrayIterator($this->seoMetadata);
        }

        foreach ($metadata as $key => $value) {
            if (is_array($value)) {
                $value = implode(',', $value);
            }

            $this->seoMetadata[] = [
                'name'    => $key,
                'content' => (string)$value
            ];
        }

        return $this;
    }
1330680
protected function onMetaReceived($metaData)
    {
        foreach ($this->params as $copy => $original) {
            $metaData["columns"][$copy] = $metaData["columns"][$original];
            $metaData["columns"][$copy]["type"] = "number";
        }
        return $metaData;
    }
724377
public function setMetaData($metaData) {
		if (is_array($metaData) && empty($metaData)) {
			$this->metaData = new \stdClass;
		} else {
			$this->metaData = $metaData;
		}

		return $this;
	}
1035476
protected function mergeMeta(array $meta, array $sourceMeta): array
    {
        $properties = $meta['properties'] ?? [];
        $sourceProperties = $sourceMeta['properties'] ?? [];

        foreach ($sourceProperties as $name => $data) {
            $properties[$name] = array_merge($properties[$name] ?? [], $data);
        }

        $meta = array_merge($meta, $sourceMeta);
        $meta['properties'] = $properties;

        return $meta;
    }
586138
protected function buildMap(array $metadata)
    {
        $className = $this->getMapClassName();
        $map = new $className($metadata['class']);

        foreach ($metadata['definitions'] as $metadataDefinition) {
            $definition = $this->buildDefinition($metadataDefinition);
            $map->addDefinition($definition);
        }

        return $map;
    }
1207635
public function withMeta($meta)
	{
		foreach (func_get_args() as $arg) {
			$metas = ($arg instanceof Collection) ? $arg->all() : is_array($arg) ? $arg : array($arg);
			
			foreach ($metas as $m) {
				if (is_object($m)) {
					$this->filters[]['metas'][] = array('id' => $m->id);
				}
				else {
					$this->filters[]['metas'][] = array('name' => $m);
				}
			}
		}
		
		return $this;
	}
248298
public function get_meta( $key ) {
		$metadata = $this->get_metadata();

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

		return $metadata[ $key ];
	}