public function toObject($applystyles = true)
    {
        if ($this->sourceType === self::SOURCE_TYPE_OBJECT && (!$applystyles || empty($this->styles))) {
            return $this->source;
        }

        $dom = $this->toDOM($applystyles);

        return $this->domToObject($dom);
    }
public function toObject($applystyles = true)
    {
        if ($this->sourceType === self::SOURCE_TYPE_OBJECT && (!$applystyles || empty($this->styles))) {
            return $this->source;
        }

        $dom = $this->toDOM($applystyles);

        return $this->domToObject($dom);
    }
public function toObject ( $ applystyles = true ) { if ( $ this -> sourceType === self :: SOURCE_TYPE_OBJECT && ( ! $ applystyles || empty ( $ this -> styles ) ) ) { return $ this -> source ; } $ dom = $ this -> toDOM ( $ applystyles ) ; return $ this -> domToObject ( $ dom ) ; }
Converts source to PHP object.

@param bool $applystyles Apply stylesheets yes/no. Default is true.

@return object

@todo support for passing XsltProcessor as parameter
@todo alternate method for converting simplexml to object?
Converts source to PHP object .