public function setMetadata($key, $value)
	{
		// The key and value should be encoded.
		$key = urlencode($key);
		$value = urlencode($value);

		if (count($this->metadataHeaders) < self::MAX_METADATA_HEADERS) {
			if (strlen($key) <= self::MAX_METADATA_KEY) {
				if (strlen($value) <= self::MAX_METADATA_VALUE) {
					$this->metadataHeaders['X-Container-Meta-' . $key] = $value;
				} else {
					throw new BadMetadataException(
						"Only " . self::MAX_METADATA_VALUE
						. " characters allowed for the metadata header value!");
				}
			} else {
				throw new BadMetadataException(
					"Only " . self::MAX_METADATA_KEY
					. " characters allowed for the metadata header key!");
			}
		} else {
			throw new BadMetadataException(
				"Only " . self::MAX_METADATA_HEADERS . " metadata headers allowed!");
		}
	}
public function setMetadata($key, $value)
	{
		// The key and value should be encoded.
		$key = urlencode($key);
		$value = urlencode($value);

		if (count($this->metadataHeaders) < self::MAX_METADATA_HEADERS) {
			if (strlen($key) <= self::MAX_METADATA_KEY) {
				if (strlen($value) <= self::MAX_METADATA_VALUE) {
					$this->metadataHeaders['X-Container-Meta-' . $key] = $value;
				} else {
					throw new BadMetadataException(
						"Only " . self::MAX_METADATA_VALUE
						. " characters allowed for the metadata header value!");
				}
			} else {
				throw new BadMetadataException(
					"Only " . self::MAX_METADATA_KEY
					. " characters allowed for the metadata header key!");
			}
		} else {
			throw new BadMetadataException(
				"Only " . self::MAX_METADATA_HEADERS . " metadata headers allowed!");
		}
	}
public function setMetadata ( $ key , $ value ) { // The key and value should be encoded. $ key = urlencode ( $ key ) ; $ value = urlencode ( $ value ) ; if ( count ( $ this -> metadataHeaders ) < self :: MAX_METADATA_HEADERS ) { if ( strlen ( $ key ) <= self :: MAX_METADATA_KEY ) { if ( strlen ( $ value ) <= self :: MAX_METADATA_VALUE ) { $ this -> metadataHeaders [ 'X-Container-Meta-' . $ key ] = $ value ; } else { throw new BadMetadataException ( "Only " . self :: MAX_METADATA_VALUE . " characters allowed for the metadata header value!" ) ; } } else { throw new BadMetadataException ( "Only " . self :: MAX_METADATA_KEY . " characters allowed for the metadata header key!" ) ; } } else { throw new BadMetadataException ( "Only " . self :: MAX_METADATA_HEADERS . " metadata headers allowed!" ) ; } }
Sets a metadata header for the container which will be created.

@param string $key The metadata header
@param string $value

@throws Guzzle\Openstack\Storage\Exception\BadMetadataException
Sets a metadata header for the container which will be created .