public static function fromObject( $object, $rootName = null, $nodeName = null, $addHeader = true )
    {
        if ( !is_object( $object ) )
        {
            throw new \InvalidArgumentException( 'The value of "$object" is not an object.' );
        }

        return static::fromArray( get_object_vars( $object ), $rootName, $nodeName, $addHeader );
    }
public static function fromObject( $object, $rootName = null, $nodeName = null, $addHeader = true )
    {
        if ( !is_object( $object ) )
        {
            throw new \InvalidArgumentException( 'The value of "$object" is not an object.' );
        }

        return static::fromArray( get_object_vars( $object ), $rootName, $nodeName, $addHeader );
    }
public static function fromObject ( $ object , $ rootName = null , $ nodeName = null , $ addHeader = true ) { if ( ! is_object ( $ object ) ) { throw new \ InvalidArgumentException ( 'The value of "$object" is not an object.' ) ; } return static :: fromArray ( get_object_vars ( $ object ) , $ rootName , $ nodeName , $ addHeader ) ; }
Converts an object to an XML string

@param mixed  $object
@param string $rootName
@param string $nodeName
@param bool   $addHeader If true, the <?xml?> header is prepended to the result

@throws \InvalidArgumentException
@return null|string
Converts an object to an XML string