public function setName($name)
    {
        if (!preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
            throw new \InvalidArgumentException(sprintf('Invalid name for metadata: `%s`.', $name));
        }

        $this->name = $name;

        return $this;
    }
public function setName($name)
    {
        if (!preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/', $name)) {
            throw new \InvalidArgumentException(sprintf('Invalid name for metadata: `%s`.', $name));
        }

        $this->name = $name;

        return $this;
    }
public function setName ( $ name ) { if ( ! preg_match ( '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/' , $ name ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid name for metadata: `%s`.' , $ name ) ) ; } $ this -> name = $ name ; return $ this ; }
Sets the name of the metadata.

@param  string $name

@return MetaData
@throws \InvalidArgumentException Occurs if $name if not a valid string.
Sets the name of the metadata .