Add meta information to the operation
@uses AbstractModel::getMeta()
@throws \InvalidArgumentException
@param string $metaName
@param mixed $metaValue
@return AbstractModel
186537
public function addMeta($metaName, $metaValue)
    {
        if (!is_scalar($metaName) || (!is_scalar($metaValue) && !is_array($metaValue))) {
            throw new \InvalidArgumentException(sprintf('Invalid meta name "%s" or value "%s". Please provide scalar meta name and scalar or array meta value.', gettype($metaName), gettype($metaValue)), __LINE__);
        }
        $metaValue = is_scalar($metaValue) ? ((is_numeric($metaValue) || is_bool($metaValue) ? $metaValue : trim($metaValue))) : $metaValue;
        if ((is_scalar($metaValue) && $metaValue !== '') || is_array($metaValue)) {
            if (!array_key_exists($metaName, $this->meta)) {
                $this->meta[$metaName] = $metaValue;
            } elseif (is_array($this->meta[$metaName]) && is_array($metaValue)) {
                $this->meta[$metaName] = array_merge($this->meta[$metaName], $metaValue);
            } elseif (is_array($this->meta[$metaName])) {
                array_push($this->meta[$metaName], $metaValue);
            } else {
                $this->meta[$metaName] = $metaValue;
            }
            ksort($this->meta);
        }
        return $this;
    }
408765
public function loadMetadataForClass($className, CommonClassMetadata $metadata)
    {
        /** @var \Doctrine\KeyValueStore\Mapping\ClassMetadata $metadata */
        try {
            $element = $this->getElement($className);
        } catch (MappingException $exception) {
            throw new \InvalidArgumentException($metadata->name . ' is not a valid key-value-store entity.');
        }

        $class = new \ReflectionClass($className);

        if (isset($element['storageName'])) {
            $metadata->storageName = $element['storageName'];
        }

        $ids = [];
        if (isset($element['id'])) {
            $ids = $element['id'];
        }

        $transients = [];
        if (isset($element['transient'])) {
            $transients = $element['transient'];
        }

        foreach ($class->getProperties() as $property) {
            if (in_array($property->getName(), $ids)) {
                $metadata->mapIdentifier($property->getName());

                continue;
            }

            if (in_array($property->getName(), $transients)) {
                $metadata->skipTransientField($property->getName());

                continue;
            }

            $metadata->mapField([
                'fieldName' => $property->getName(),
            ]);
        }
    }
584469
public function addParameter($parameterName, $parameterValue)
    {
        $this->addKey($parameterName);

        if (!is_string($parameterValue)) {
            throw new \InvalidArgumentException('Parameter definition must be string');
        }

        $this->parameters[$parameterName] = $parameterValue;

        return $this;
    }
875898
public function getMeta($property = null, $fallbackValue = "")
    {
        if (is_null($property)) {
            $varReturn = $this->__meta;
        } elseif (isset($this->__meta[$property])
            && !is_null($this->__meta[$property])
        ) {
            $varReturn = $this->__meta[$property];
        } else {
            $varReturn = $fallbackValue;
        }

        return $varReturn;
    }
596243
public function add(MetaSetInterface $metaSet)
    {
        $this->metaSets[$metaSet->getId()] = $metaSet;
        $this->nameMap[$metaSet->getName()] = $metaSet->getId();

        return $this;
    }
623289
public function setMeta($meta): self
    {
        $this->hasMeta = true;
        $this->meta    = $meta;

        return $this;
    }
251667
public function meta(string $name, $value = null)
    {
        if ($value === null) {
            return $this->getMeta($name);
        }

        $this->setMeta($name, $value);
    }
778223
public function setMetas(array $metas): MetaAwareInterface
    {
        $this->metas = $metas;

        //convert pluginAnnotation meta to correct key:value pair
        foreach ($this->metas as $index => $meta) {
            if ($meta instanceof PluginConfigAnnotation) {
                unset($this->metas[$index]);
                $this->setMeta($meta->getName(), $meta->getConfig());
            }
        }

        return $this;
    }
40830
public function fixMetadataReferences(Resource $meta): Resource {
        $properties = array_diff($meta->propertyUris(), array(RC::idProp()));
        foreach ($properties as $p) {
            foreach ($meta->allResources($p) as $obj) {
                $id  = null;
                $uri = $obj->getUri();
                try {
                    $res = $this->getResourceById($uri);
                    $id  = $res->getId();
                } catch (NotFound $e) {
                    try {
                        $res = $this->getResourceByUri($uri);
                        $id  = $res->getId();
                    } catch (NotFound $e) {
                        
                    } catch (NoAcdhId $e) {
                        
                    } catch (ClientException $e) {
                        
                    }
                } catch (NoAcdhId $e) {
                    
                } catch (ClientException $e) {
                    
                }

                if ($id !== null && $id !== $obj->getUri()) {
                    $meta->delete($p, $obj);
                    $meta->addResource($p, $id);
                }
            }
        }
        return $meta;
    }
514047
function meta()
    {
        if (!$this->_rMetaInfo)
            $this->_rMetaInfo = new MetaReaderOfPhpResource($this->getRHandler());

        return $this->_rMetaInfo;
    }
883867
function with($meta, $operator = null, $value = null)
	{
		
		list($value, $operator) = $this->prepareValueAndOperator(
			$value, $operator, func_num_args() == 2
		);

		static $count;
		if (empty($count)) {
			$count = 0;
		}
		
		if (!is_array($meta)) {
			$meta = [ $meta => $value ];
		}

		foreach($meta as $key => $value) {
			$alias = '_with_condition_'.(++$count);
			$this->query->join("postmeta as {$alias}", "{$alias}.post_id", '=', 'ID');
			$this->query->where("{$alias}.meta_key", '_' . $key);
			$this->query->where("{$alias}.meta_value", $operator, $value);
		}

		return $this;
	}
167357
public function setMeta(string $key, $value): MetaAwareInterface
    {
        //convert pluginAnnotation meta to correct key:value pair
        if ($value instanceof PluginConfigAnnotation) {
            $key = $value->getName();
            $value = $value->getConfig();
        }

        $this->metas[$key] = $value;

        return $this;
    }
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;
  }
626551
function withMeta($data)
    {
        $meta = $this->_assertMetaData($data);

        $new = clone $this;
        $new->meta = array_merge($this->meta, $meta);
        return $new;
    }
1288070
public function transform(Metadata $meta, $entity)
    {
        $this->validateConfiguration($meta, $entity, 'show');

        $this->eventDispatcher->dispatch(Events::PRE_SHOW_VIEW_CREATING, new ShowViewEvent($entity));

        $view = new ShowView();

        $configuration = $meta->getConfiguration();
        $translationPrefix = $meta->getEntityTranslationPrefix();

        foreach ($configuration['view']['show']['fields'] as $field => $attr) {
            if ($this->fieldBlacklistManager->isFieldBlacklisted($meta, $field, '[view][show]')
                || $this->isFieldContentHidden($attr, $entity)
            ) {
                continue;
            }

            $label = $translationPrefix.StringsUtil::toUnderscore($field);

            $content = $this->getFieldContent($entity, $field, $attr, $meta->getMappings());

            $view->addItem(new Item($label, $content));
        }

        return $view;
    }
278652
public function getMetaValue($name)
    {
        /** @var PostMeta $meta */
        foreach ($this->getMetas() as $meta) {
            if ($name == $meta->getKey()) {
                return $meta->getValue();
            }
        }

        return;
    }
692131
public function setMeta($key, $value = null)
    {
        if (is_array($key) && is_null($value)) {
            $this->meta = $key;
        } else {
            array_set($this->meta, $key, $value);
        }

        return $this;
    }