public function setType($type)
    {
        if (!is_string($type) || empty($type)) {
            throw MetadataException::invalidEntityType();
        }
        $this->type = $type;
        return $this;
    }
public function setType($type)
    {
        if (!is_string($type) || empty($type)) {
            throw MetadataException::invalidEntityType();
        }
        $this->type = $type;
        return $this;
    }
public function setType ( $ type ) { if ( ! is_string ( $ type ) || empty ( $ type ) ) { throw MetadataException :: invalidEntityType ( ) ; } $ this -> type = $ type ; return $ this ; }
Sets the entity type.

@param   string  $type
@return  self
@throws  MetadataException   If the type is not a string or is empty.
Sets the entity type .