public function setMetadata($key, $data = null)
    {
        if (is_null($data)) {
            unset($this->_metadata[$key]);
        } else {
            $this->_metadata[$key] = $data;
        }
    }
public function setMetadata($key, $data = null)
    {
        if (is_null($data)) {
            unset($this->_metadata[$key]);
        } else {
            $this->_metadata[$key] = $data;
        }
    }
public function setMetadata ( $ key , $ data = null ) { if ( is_null ( $ data ) ) { unset ( $ this -> _metadata [ $ key ] ) ; } else { $ this -> _metadata [ $ key ] = $ data ; } }
Set a piece of metadata on this object.

@param string $key  The metadata key.
@param mixed $data  The metadata. If null, clears the key.
Set a piece of metadata on this object .