PHP Class Horde_SyncMl_Command, horde

A SyncML command is a protocol primitive. Each SyncML command specifies to a recipient an individual operation that is to be performed. The Horde_SyncMl_Command objects are hooked into the XML parser of the Horde_SyncMl_ContentHandler class and are reponsible for parsing a single command inside the SyncBody section of a SyncML message. All actions that must be executed for a single SyncML command are handled by these objects, by means of the handleCommand() method. Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Anthony Mills ([email protected])
Author: Jan Schneider ([email protected])
Show file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_chars string Buffer for the parsed character data.
$_cmdID integer The command ID ().
$_cmdName string Must be overwritten by a sub class.
$_outputHandler Horde_SyncMl_XmlOutput A Horde_SyncMl_XmlOutput instance responsible for generating the output.
$_stack array Stack for holding the XML elements during creation of the object from the XML event flow.

Public Methods

Method Description
__construct ( Horde_SyncMl_XmlOutput &$outputHandler ) Constructor.
characters ( string $str ) Character data handler for the XML parser, delegated from Horde_SyncMl_ContentHandler::characters().
endElement ( string $uri, string $element ) End element handler for the XML parser, delegated from Horde_SyncMl_ContentHandler::endElement().
factory ( string $command, Horde_SyncMl_XmlOutput &$outputHandler ) : Horde_SyncMl_Command Attempts to return a concrete Horde_SyncMl_Command instance based on $command.
getCommandName ( ) : string Returns the command name this instance is reponsible for.
handleCommand ( $debug = false ) This method is supposed to implement the actual business logic of the command once the XML parsing is complete.
startElement ( string $uri, string $element, array $attrs ) Start element handler for the XML parser, delegated from Horde_SyncMl_ContentHandler::startElement().

Method Details

__construct() public method

Constructor.
public __construct ( Horde_SyncMl_XmlOutput &$outputHandler )
$outputHandler Horde_SyncMl_XmlOutput A Horde_SyncMl_XmlOutput object.

characters() public method

Character data handler for the XML parser, delegated from Horde_SyncMl_ContentHandler::characters().
public characters ( string $str )
$str string The data string.

endElement() public method

End element handler for the XML parser, delegated from Horde_SyncMl_ContentHandler::endElement().
public endElement ( string $uri, string $element )
$uri string The namespace URI of the element.
$element string The element tag name.

factory() public method

Attempts to return a concrete Horde_SyncMl_Command instance based on $command.
public factory ( string $command, Horde_SyncMl_XmlOutput &$outputHandler ) : Horde_SyncMl_Command
$command string The type of the concrete Horde_SyncMl_Comment subclass to return.
$outputHandler Horde_SyncMl_XmlOutput A Horde_SyncMl_XmlOutput object.
return Horde_SyncMl_Command The newly created concrete Horde_SyncMl_Command instance, or false on error.

getCommandName() public method

Returns the command name this instance is reponsible for.
public getCommandName ( ) : string
return string The command name this object is handling.

handleCommand() public method

This method is supposed to implement the actual business logic of the command once the XML parsing is complete.
public handleCommand ( $debug = false )

startElement() public method

Start element handler for the XML parser, delegated from Horde_SyncMl_ContentHandler::startElement().
public startElement ( string $uri, string $element, array $attrs )
$uri string The namespace URI of the element.
$element string The element tag name.
$attrs array A hash with the element's attributes.

Property Details

$_chars protected property

Buffer for the parsed character data.
protected string $_chars
return string

$_cmdID protected property

The command ID ().
protected int $_cmdID
return integer

$_cmdName protected property

Must be overwritten by a sub class.
protected string $_cmdName
return string

$_outputHandler protected property

A Horde_SyncMl_XmlOutput instance responsible for generating the output.
protected Horde_SyncMl_XmlOutput $_outputHandler
return Horde_SyncMl_XmlOutput

$_stack protected property

Stack for holding the XML elements during creation of the object from the XML event flow.
protected array $_stack
return array