Location: PHPKode > projects > SimpleSPML > SimpleSPML/lib/msg/suspend/SuspendResponse.php
<?php
require_once "lib/msg/core/Response.php";

/*
<element name = "suspendResponse" type = "spml:ResponseType" />
*/

/**
 * SuspendResponse
 * 
 * Provider response to a SuspendRequest message
 * 
 * @package SimpleSPML
 * @author Alessandra Bozzo <hide@address.com>
 */
class SuspendResponse extends Response
{
    /**
     * Constructor
     */
    public function __construct()
    {
        parent::__construct();
    }
    
    /**
     * Read the SPML message
     * @access public
     * @param SimpleXMLIterator $obj
     */
    public function readMessage($obj)
    {
        $this->checkNamespace($obj, "urn:oasis:names:tc:SPML:2:0");
        
        parent::readMessage($obj);
        
        if(!$this->isValid())
            throw new InvalidMessageException(get_class($this));
    }
    
    /**
     * Write the SPML message
     * @access public
     * @param int $level
     * @return string
     */
    public function writeMessage($level = 0)
    {
        if(!$this->isValid())
            throw new InvalidObjectException(get_class($this));
        
        $ind = $this->indentation($level);
        
        $spmlstr = $ind . '<suspendResponse xmlns="urn:oasis:names:tc:SPML:2:0"';
        
        // write suspendResponse attributes
        $spmlstr .= $this->writeAttributes();
                
        // write parent elements
        $spmlmidstr = parent::writeMessage($level + 1);
        
        return $this->tagCloser("suspendResponse", $spmlstr, $spmlmidstr, $ind);
    }
}
?>
Return current item: SimpleSPML