@param JsonMeta $value

@return $this
@throws \TypeError Wrong type of meta
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;
  }
426439
public function setMeta($key, $value = null)
    {
        $setMeta = 'setMeta'.ucfirst(gettype($key));

        return $this->$setMeta($key, $value);
    }
373918
public function jsonEncode($value)
    {
        // if json_encode exists use that
        if (extension_loaded('json') && function_exists('json_encode')) {
            $encodedValue = json_encode($value);
            if (!empty($encodedValue)) {
                return $encodedValue;
            }
        }

        try {
            return \Zend\Json\Encoder::encode($value);
        } catch (Exception $exception) {
            return false;
        }
    }
980844
public function setMeta($id, $name, $value, $field = 'value') {
        if (is_array($value)) {
            $value = json_encode($value, JSON_UNESCAPED_UNICODE);
        }

        return $this->updateMeta($id, $name, $field, $value);
    }
106503
public static function meta($key = null, $value = null) {
		$self = static::_object();
		$isArray = is_array($key);

		if ($value || $isArray) {
			$value ? $self->_meta[$key] = $value : $self->_meta = $key + $self->_meta;
			return;
		}
		return $self->_getMetaKey($isArray ? null : $key);
	}
59756
public function set($key, $value)
    {
        $value = $this->plain($value);
        $method = 'set'.$key;

        if (method_exists($this, $method)) {
            return $this->$method($value);
        }

        return $this->metas[$key] = self::cut($value, $key);
    }
150526
public function addMetaData($key, $value, $overwrite = true)
    {
        $this->meta[$key] = isset($this->meta[$key])
            ? $overwrite ? $value : $this->meta[$key]
            : $value;

        return $this;
    }
1132664
protected function accessMetableAttribute($value): Meta
    {
        $meta = [];

        if ($value instanceof Meta) {
            return $value;
        } elseif (! \is_null($value)) {
            $meta = $this->fromJson($value);
        }

        return new Meta($meta);
    }
927386
public function setMeta(array $meta)
    {
        foreach ($meta as $name => $value) {
            if (empty($value)) {
                unset($meta[$name]);
            }
        }

        $this->meta = $meta;

        return $this;
    }
241539
public function addOrUpdateMeta($key, $value)
    {
        return $this->hasMeta($key) ? $this->updateMeta($key, $value) : $this->addMeta($key, $value);
    }
1240105
public function setMetaKey($value)
    {
        $this->_validateNotNull('MetaKey', $value);
        $this->_validateString('MetaKey', $value);

        if ($this->data['meta_key'] === $value) {
            return;
        }

        $this->data['meta_key'] = $value;

        $this->_setModified('meta_key');
    }
784672
public function setXmlBasicMetadata(\AgentSIB\Diadoc\Api\Proto\Events\EncryptedXmlBasicDocumentMetadata $value)
    {
        $this->XmlBasicMetadata = $value;
    }
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;
    }
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;
	}
542780
public function put($key, $value)
	{
		if(gettype($value) == 'object' && !($value instanceof JSONObject) && !($value instanceof JSONArray))
		{
			$value = new JSONObject($value);
		}
		if($key == '' || $key == NULL)
			throw new JSONException("Null key.");
		
		$this->testValidity($value);
		$this->map[$key] = $value;
		
		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;
	}
1222082
public JsonArray add(Object value) {
        if (value == this) {
            throw new IllegalArgumentException("Cannot add self");
        } else if (value == JsonValue.NULL) {
            addNull();
        } else if (checkType(value)) {
            content.add(value);
        } else {
            throw new IllegalArgumentException("Unsupported type for JsonArray: " + value.getClass());
        }
        return this;
    }