Gets/sets the body of this message.

@param  mixed      $value         The formatted body.
@param  array      $options       The stream options.
@param  array      $mediaOptions  The media options.
@return mixed|self
356179
public function set($value = null, $options = [], $mediaOptions = [])
    {
        $media = $this->_classes['media'];
        $format = $this->format();

        if (!$format && !is_string($value)) {
            throw new NetException("The data must be a string when no format/mime is defined.");
        }

        $stream = $this->stream();
        $stream->close();
        $stream->add($format ? $media::encode($format, $value, $mediaOptions, $this) : $value, $options);
        return $this;
    }
1231068
public function setOption($name, $value)
    {
        if (!is_string($name)) {
            throw new Exception('invalid options name');
        }
        $name = strtolower($name);
        if ($name == 'result_store') {
            $this->options['result_store'] = $value;
            $this->setResultStore($value);
        } elseif ($name == 'broker') {
            $this->options['broker'] = $value;
            $this->setBroker($value);
        }
        return $this;
    }
271222
public function setOption($option, $value)
    {
        if (array_key_exists($option, $this->options)) {
            $this->options[$option] = $value;
        }
        return $this;
    }
1047923
public function renderMedia($mediaId, array $options = array())
    {
        $media = $this->getMedia($mediaId);

        if ($media) {
            return $this->displayMediaManager->renderMedia($media, $options);
        }

        return '';
    }
645477
public function load(ClassMetadata $class, $value, $options = array())
    {
        $client = $this->sm->getClient();

        if (isset($options['field'])) {
            $document = $client->findOneBy($class, $options['field'], $value);
        } else {
            $document = $client->find($class, $value, $options);
        }

        return $this->hydrateEntity($class, $document);
    }
464424
public function serialize($value, array $options = [])
    {

        if (!is_object($value) && !is_array($value)) {
            return $value;
        }

        if (is_array($value) || $value instanceof Serializable) {
            return serialize($value);
        }

        if (!$value instanceof Identifiable) {
            throw new UnsupportedParameterException("Cannot serialize value of type " . Type::of($value));
        }

        if($pointer = $this->entityManager->pointer($value)) {
            return $this->serialize($pointer);
        };

        throw new UnsupportedParameterException("Cannot serialize value of type " . Type::of($value));

    }
947824
protected function getForm($formName, MediaProviderInterface $mediaProvider, array $options = array())
    {
        return $this->formFactory->createBuilder($formName, $mediaProvider, $options)->getForm();
    }
1354586
public function getFormByMediaProvider(MediaProviderInterface $mediaProvider, array $options = array())
    {
        $formName = $this->providerService->getProviderManager($mediaProvider->getMedia()->getContext())->getFormName();
        return $this->getForm($formName, $mediaProvider, $options);
    }
797044
public function setOption($option, $value = '')
    {
        if (is_array($option)) {
            foreach ($option as $key => $value) {
                $this->options[$key] = $value;
            }
        }
        else {
            $this->options[$option] = $value;
        }

        return $this;
    }
677466
public static function Base64Decode ($value, $options = []) {
		$value = base64_decode($value);

		$to_encoding = isset($options['to_encoding']) ? $options['to_encoding'] : false;
		if ($to_encoding !== false) {
			$from_encoding = isset($options['from_encoding']) ? $options['from_encoding'] : static::DEFAULT_ENCODING;
			return mb_convert_encoding($value, $to_encoding, $from_encoding);
		}

		return $value;
	}
560282
public static function encode($value, $options = 0)
    {
        $result = json_encode($value, (int) $options);
        // @codeCoverageIgnoreStart
        if ($result === false) {
            throw new \RuntimeException(static::$errorMessages[json_last_error()]);
        }
        // @codeCoverageIgnoreEnd

        return $result;
    }
408592
public function altBody($value = null)
    {
        if (!func_num_args()) {
            return $this->_altBody;
        }
        $this->_altBody = (string) $value;
        return $this;
    }
230481
public function setOption($option, $value)
    {
        switch ($option) {
            case FTPClient::TIMEOUT_SEC:
                if ($value <= 0) {
                    throw new Exception('Timeout value must be greater than zero');
                }
                break;

            case FTPClient::AUTOSEEK:
                if (!is_bool($value)) {
                    throw new Exception('Autoseek value must be boolean');
                }
                break;
            
            default:
                throw new Exception('Unsupported option');
                break;
        }

        return @ftp_set_option($this->connection, $option, $value);
    }
1217773
public static function json(&$value, $options = ['json_assoc'=>true, 'json_schema'=>[], 'default'=>null])
    {
        $json_assoc = isset($options['json_assoc']) && $options['json_assoc'] ? true : false;
        $value = @json_decode(trim($value), $json_assoc);

        if ($value !== null && $json_assoc && isset($options['json_schema']) && $options['json_schema'] && is_array($options['json_schema'])) {
            foreach ($options['json_schema'] as $field => $opt_arr) {
                self::validate(
                    $value[$field],
                    isset($opt_arr[0]) ? $opt_arr[0] : self::NONE_TYPE,
                    isset($opt_arr[1]) && is_array($opt_arr[1]) ? $opt_arr[1] : []
                );
            }
        } elseif ($value === null) {
            $value = isset($options['default']) ? $options['default'] : null;
        }

        return $value;
    }
1144525
public function media($media, $format, $options = [])
    {
        return $this->getTwigExtension()->media($media, $format, $options);
    }
1219369
public function set(string $option, $value): self {
        $this->options[$option] = $value;

        return $this;
    }
678479
public function filter($value, $options = [])
    {
        if ($this->getPattern() == null) {
            $ex = new \Exception(get_class($this) . ' does not have a valid MatchPattern set.');
            throw $ex;
        }

        return preg_replace($this->getPattern(), $this->getReplacement(), $value);
    }