PHP Class Horde_ActiveSync_Message_Base, horde

Author: Michael J Rubinsky ([email protected])
Datei anzeigen Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$commandType string @since 2.31.0
$flags Horde_ActiveSync::FLAG_ Message flags

Protected Properties

Property Type Description
$_device Horde_ActiveSync_Device The device object
$_exists array Existence cache, used for working with ghosted properties.
$_logger Horde_Log_Logger Logger
$_mapping array Holds the mapping for object properties
$_properties array Holds property values
$_streamFilters array Cache of current stream filters.
$_supported array An array describing the non-ghosted elements this message supports.
$_version float The version of EAS we are to support.

Public Methods

Method Description
__call ( mixed $method, array $arg ) : mixed Magic caller method.
__construct ( array $options = [] ) : Horde_ActiveSync_Message_Base Const'r
__destruct ( )
__get ( string $property ) : mixed Accessor
__isset ( string $property ) : boolean. Magic method.
__set ( string $property, mixed $value ) Setter
decodeStream ( Horde_ActiveSync_Wbxml_Decoder &$decoder ) Recursively decodes the WBXML from input stream. This means that if this message contains complex types (like Appointment.Recuurence for example) the sub-objects are auto-instantiated and decoded as well. Places the decoded objects in the local properties array.
encodeStream ( Horde_ActiveSync_Wbxml_Encoder &$encoder ) Encodes this object (and any sub-objects) as wbxml to the output stream.
getProtocolVersion ( ) : float Return the EAS version this object supports.
getSupported ( ) : array Get the list of non-ghosted properties for this message.
isEmpty ( ) : boolean Returns whether or not this message actually contains any data to send.
isGhosted ( string $property ) : boolean Determines if the property specified has been ghosted by the client.
propertyExists ( string $property ) : boolean Check the existence of a property in this message.
setSupported ( array $fields ) Set the list of non-ghosted fields for this message.

Protected Methods

Method Description
_checkEncoding ( mixed $data, string $tag ) : mixed Checks if the data needs to be encoded like e.g., when outputing binary data in-line during ITEMOPERATIONS requests. Concrete classes should override this if needed.
_checkSendEmpty ( string $tag ) : boolean Checks to see if we should send an empty value.
_formatDate ( Horde_Date $dt, integer $type ) : string Oh yeah. This is beautiful. Exchange outputs date fields differently in calendar items and emails. We could just always send one or the other, but unfortunately nokia's 'Mail for exchange' depends on this quirk.
_getAttribute ( string $name, stting $default = null ) : mixed Helper method to allow default values for unset properties.
_parseDate ( string $ts ) : Horde_Date | boolean Get a Horde_Date from a timestamp, ensuring it's in the correct format.
_preEncodeValidation ( ) : boolean Give concrete classes the chance to enforce rules before encoding messages to send to the client.
_validateDecodedValues ( ) : boolean Give concrete classes the chance to enforce rules.

Private Methods

Method Description
_hex2bin ( string $data ) : string Function which converts a hex entryid to a binary entryid.

Method Details

__call() public method

Magic caller method.
public __call ( mixed $method, array $arg ) : mixed
$method mixed The method to call.
$arg array Method arguments.
return mixed

__construct() public method

Const'r
public __construct ( array $options = [] ) : Horde_ActiveSync_Message_Base
$options array Configuration options for the message: - logger: (Horde_Log_Logger) A logger instance DEFAULT: none (No logging). - protocolversion: (float) The version of EAS to support. DEFAULT: Horde_ActiveSync::VERSION_TWOFIVE (2.5) - device: (Horde_ActiveSync_Device) The device object. @since 2.9.2
return Horde_ActiveSync_Message_Base

__destruct() public method

public __destruct ( )

__get() public method

Accessor
public __get ( string $property ) : mixed
$property string Property to get.
return mixed The value of the requested property.

__isset() public method

Magic method.
public __isset ( string $property ) : boolean.
$property string The property name to check.
return boolean.

__set() public method

Setter
public __set ( string $property, mixed $value )
$property string The property to set.
$value mixed The value to set it to.

_checkEncoding() protected method

Checks if the data needs to be encoded like e.g., when outputing binary data in-line during ITEMOPERATIONS requests. Concrete classes should override this if needed.
protected _checkEncoding ( mixed $data, string $tag ) : mixed
$data mixed The data to check. A string or stream resource.
$tag string The tag we are outputing.
return mixed The encoded data. A string or stream resource with a filter attached.

_checkSendEmpty() protected method

Checks to see if we should send an empty value.
protected _checkSendEmpty ( string $tag ) : boolean
$tag string The tag name
return boolean

_formatDate() protected method

So we have to send a different date type depending on where it's used. Used when encoding a date value to send to the client.
protected _formatDate ( Horde_Date $dt, integer $type ) : string
$dt Horde_Date The Horde_Date object to format (should normally be in local tz).
$type integer The type to format as: One of TYPE_DATE or TYPE_DATE_DASHES, TYPE_DATE_LOCAL
return string The formatted date

_getAttribute() protected method

Helper method to allow default values for unset properties.
protected _getAttribute ( string $name, stting $default = null ) : mixed
$name string The property name
$default stting The default value to return if $property is empty
return mixed

_parseDate() protected method

Used when decoding an incoming date value from the client.
protected _parseDate ( string $ts ) : Horde_Date | boolean
$ts string The timestamp
return Horde_Date | boolean The Horde_Date or false if unable to decode.

_preEncodeValidation() protected method

Give concrete classes the chance to enforce rules before encoding messages to send to the client.
Since: 2.31.0
protected _preEncodeValidation ( ) : boolean
return boolean True if values were valid (or could be made valid). False if values are unable to be validated.

_validateDecodedValues() protected method

Give concrete classes the chance to enforce rules.
Since: 2.31.0
protected _validateDecodedValues ( ) : boolean
return boolean True on success, otherwise false.

decodeStream() public method

Recursively decodes the WBXML from input stream. This means that if this message contains complex types (like Appointment.Recuurence for example) the sub-objects are auto-instantiated and decoded as well. Places the decoded objects in the local properties array.
public decodeStream ( Horde_ActiveSync_Wbxml_Decoder &$decoder )
$decoder Horde_ActiveSync_Wbxml_Decoder

encodeStream() public method

Output is ordered according to $_mapping
public encodeStream ( Horde_ActiveSync_Wbxml_Encoder &$encoder )
$encoder Horde_ActiveSync_Wbxml_Encoder The wbxml stream encoder

getProtocolVersion() public method

Return the EAS version this object supports.
public getProtocolVersion ( ) : float
return float A Horde_ActiveSync::VERSION_* constant.

getSupported() public method

Get the list of non-ghosted properties for this message.
public getSupported ( ) : array
return array The array of non-ghosted properties

isEmpty() public method

Returns whether or not this message actually contains any data to send.
Since: 2.34.0
public isEmpty ( ) : boolean
return boolean True if message is empty, otherwise false.

isGhosted() public method

A property is ghosted if it is NOT listed in the SUPPORTED list sent by the client AND is NOT present in the request data.
public isGhosted ( string $property ) : boolean
$property string The property to check
return boolean

propertyExists() public method

Check the existence of a property in this message.
public propertyExists ( string $property ) : boolean
$property string The property name
return boolean

setSupported() public method

Set the list of non-ghosted fields for this message.
public setSupported ( array $fields )
$fields array The array of fields, keyed by the fully qualified property name i.e., POOMCONTACTS:Anniversary. To signify an empty SUPPORTED container $fields should contain a single element equal to Horde_ActiveSync::ALL_GHOSTED.

Property Details

$_device protected_oe property

The device object
Since: 2.9.2
protected Horde_ActiveSync_Device $_device
return Horde_ActiveSync_Device

$_exists protected_oe property

Existence cache, used for working with ghosted properties.
protected array $_exists
return array

$_logger protected_oe property

Logger
protected Horde_Log_Logger $_logger
return Horde_Log_Logger

$_mapping protected_oe property

Holds the mapping for object properties
protected array $_mapping
return array

$_properties protected_oe property

Holds property values
protected array $_properties
return array

$_streamFilters protected_oe property

Cache of current stream filters.
protected array $_streamFilters
return array

$_supported protected_oe property

An array describing the non-ghosted elements this message supports.
protected array $_supported
return array

$_version protected_oe property

The version of EAS we are to support.
protected float $_version
return float

$commandType public_oe property

@since 2.31.0
public string $commandType
return string

$flags public_oe property

Message flags
public Horde_ActiveSync::FLAG_ $flags
return Horde_ActiveSync::FLAG_