Set the result meta.

@param array $meta
@return $this
160620
public function setMeta(array $meta)
    {
        $this->took = isset($meta['took']) ? $meta['took'] : null;
        $this->timed_out = isset($meta['timed_out']) ? $meta['timed_out'] : null;
        $this->shards = isset($meta['_shards']) ? $meta['_shards'] : null;
        $this->hits = isset($meta['hits']) ? $meta['hits'] : null;
        $this->aggregations = isset($meta['aggregations']) ? $meta['aggregations'] : [];

        return $this;
    }
4357
public function setMeta($content)
    {
        $key = '_meta_tags';

        if (!isset($this->data[$key])) {
            $this->data[$key] = array();
        }

        $this->data[$key][] = $content;
    }
332891
public function setMeta( $value ) {
    if( !( $value instanceof JsonMeta ) ) throw new \TypeError( 'Meta must be a subclass of ' . JsonMeta::class, $value );
    else $this->_meta = $value;

    return $this;
  }
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;
                }
            }
        }
    }
349095
public function setMetaData(array $metaData, $merge = true)
    {
        $this->config->setMetaData($metaData, $merge);

        return $this;
    }
643240
public function setMeta($meta, $value = null)
	{
		$metas = is_array($meta) ? $meta : array($meta => $value);
		
		foreach ($metas as $m => $v) {
			if (!is_object($m)) {
				$m = $this->findMetaByNameOrCreate($m);
			}
			
			if (!$m || !$m instanceof Eloquent) {
				continue;
			}
			
			if ($this->hasMeta($m)) {
				if (is_null($v)) {
					$this->unsetMeta($m);
					continue;
				}
				
				$attributes = array(
					'value'           => $v,
					'meta_updated_at' => date('Y-m-d H:i:s'),
				);
				$this->metas()->updateExistingPivot($m->id, array_merge($this->metableTableSyncAttributes(), $attributes));
				$this->metas->find($m->id)->pivot->value = $v;
				$this->metas->find($m->id)->pivot->meta_updated_at = $attributes['meta_updated_at'];
			}
			else {
				if (is_null($v)) {
					continue;
				}
				
				$this->metas()->attach($m, array_merge($this->metableTableSyncAttributes(), array(
					'value'           => $v,
					'meta_created_at' => date('Y-m-d H:i:s'),
					'meta_updated_at' => date('Y-m-d H:i:s'),
				)));
				
				$m->increment('num_items');
				
				$this->metas->add($m);
			}
		}
		
		return $this;
	}
1088859
protected function onMetaReceived($metaData)
    {
        if (is_array($this->params)) {
            foreach ($this->params as $cName => $cMap) {
                if (is_array($cMap)) {
                    $cMeta = Utility::get($cMap, "{meta}");
                    if ($cMeta) {
                        $override = Utility::get($cMeta, "{override}", false);
                        if (isset($cMeta["{override}"])) {
                            unset($cMeta["{override}"]);
                        }
                        if ($override) {
                            $metaData["columns"][$cName] = $cMeta;
                        } else {
                            $metaData["columns"][$cName] = array_merge($metaData["columns"][$cName], $cMeta);
                        }
                    }
                }
            }
        }

        return $metaData;
    }
1203791
public function selectMeta(string $fieldName, string $metaDataKeyword) : self
    {
        $this->query['select'][$fieldName] = ['$meta' => $metaDataKeyword];
        return $this;
    }
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;
    }
174317
public static function validateMeta(array &$array)
    {

        foreach ($array as $key => $tag) {
            if (!($tag instanceof Meta)) {
                $newtag = new Meta($tag);
                $array[$key] = $newtag;
            }
        }
    }
568447
public function parse($class, array $meta = [])
    {
        $methods = get_class_methods($class);
        foreach($methods as $method) {
            $query = Annotation::ofMethod($class, $method, 'uri');
            if($query) {
                $this->add($query, [$class, $method], $meta);
            }
        }

        return $this;
    }
271337
public function set(array $data)
    {
        foreach ($data as $key => $value) {
            if (method_exists($this, 'set' . $key)) {
                $this->{'set' . $key}($value);
            }
        }

        return $this;
    }
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;
	}
144506
public function addMeta($key, $data = null)
    {
        if (is_array($key)) {
            $this->meta += $key;
        } else {
            $this->meta[$key] = $data;
        }

        return $this;
    }
491919
protected function addMetaData($event, array $metaData)
    {
        if (is_array($metaData) && count($metaData)) {
            foreach ($metaData as $key => $metaDatum) {
                $method = 'set' . ucfirst($key);

                if (method_exists($event, $method)) {
                    $event->$method($metaDatum);
                }
            }
        }
    }
220259
public function import(Meta $metaNodes)
    {
        if (is_array($metaNodes = $metaNodes->getArrayCopy())) {
            foreach ($metaNodes as $name => $value) {
                $this->offsetSet($name, $value);
            }
        }

        return $this;
    }
1263658
protected function setMetadata($metadata, $value = null)
	{
		if ( ! is_array($metadata))
		{
			$metadata = [(string) $metadata => $value];
		}
		
		$this->metadata = array_filter($metadata, 'is_scalar');
		
		return $this;
	}