Constants

KEY_ATTRIBUTE

KEY_ATTRIBUTE

KEY_VALUES

KEY_VALUES

KEY_TYPE

KEY_TYPE

KEY_PROPERTY

KEY_PROPERTY

TYPE_DATE

TYPE_DATE

TYPE_HEX

TYPE_HEX

TYPE_DATE_DASHES

TYPE_DATE_DASHES

TYPE_MAPI_STREAM

TYPE_MAPI_STREAM

TYPE_MAPI_GOID

TYPE_MAPI_GOID

TYPE_DATE_LOCAL

TYPE_DATE_LOCAL

PROPERTY_NO_CONTAINER

PROPERTY_NO_CONTAINER

Properties

$flags

$flags : \Horde_ActiveSync::FLAG_*

Message flags

Type

\Horde_ActiveSync::FLAG_* — constant

$commandType

$commandType : string

Request type. One of: Horde_ActiveSync::SYNC_ADD, SYNC_MODIFY, SYNC_REMOVE, or SYNC_FETCH. Used internally for enforcing various protocol rules depending on request.

@since 2.31.0

Type

string

$messages

$messages : 

Type

$state

$state : integer

Type

integer

$starttime

$starttime : \Horde_Date

Type

\Horde_Date

$endtime

$endtime : \Horde_Date

Type

\Horde_Date

$message

$message : \Horde_ActiveSync_Message_OofMessage

Type

\Horde_ActiveSync_Message_OofMessage

$bodytype

$bodytype : string

Type

string

$_mapping

$_mapping : array

Property mapping

Type

array

$_properties

$_properties : array

Property values.

Type

array

$_logger

$_logger : \Horde_Log_Logger

Logger

Type

\Horde_Log_Logger

$_supported

$_supported : array

An array describing the non-ghosted elements this message supports.

Type

array

$_exists

$_exists : array

Existence cache, used for working with ghosted properties.

Type

array

$_version

$_version : float

The version of EAS we are to support.

Type

float

$_streamFilters

$_streamFilters : array

Cache of current stream filters.

Type

array

Methods

__construct()

__construct(array  $options = array()) : \Horde_ActiveSync_Message_Base

Const'r

Parameters

array $options

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

Returns

\Horde_ActiveSync_Message_Base

__destruct()

__destruct() 

getProtocolVersion()

getProtocolVersion() : float

Return the EAS version this object supports.

Returns

float —

A HordeActiveSync::VERSION* constant.

propertyExists()

propertyExists(string  $property) : boolean

Check the existence of a property in this message.

Parameters

string $property

The property name

Returns

boolean

__get()

__get(string  $property) : mixed

Accessor

Parameters

string $property

Property to get.

Returns

mixed —

The value of the requested property.

__set()

__set(string  $property, mixed  $value) 

Setter

Parameters

string $property

The property to set.

mixed $value

The value to set it to.

Throws

\InvalidArgumentException

__call()

__call(mixed  $method, array  $arg) : mixed

Magic caller method.

Parameters

mixed $method

The method to call.

array $arg

Method arguments.

Returns

mixed

__isset()

__isset(string  $property) : \boolean.

Magic method.

Parameters

string $property

The property name to check.

Returns

\boolean.

setSupported()

setSupported(array  $fields) 

Set the list of non-ghosted fields for this message.

Parameters

array $fields

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.

getSupported()

getSupported() : array

Get the list of non-ghosted properties for this message.

Returns

array —

The array of non-ghosted properties

isGhosted()

isGhosted(string  $property) : boolean

Determines if the property specified has been ghosted by the client.

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.

Parameters

string $property

The property to check

Returns

boolean

decodeStream()

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.

Parameters

\Horde_ActiveSync_Wbxml_Decoder $decoder

Throws

\Horde_ActiveSync_Exception

encodeStream()

encodeStream(\Horde_ActiveSync_Wbxml_Encoder  $encoder) 

Encodes this object (and any sub-objects) as wbxml to the output stream.

Output is ordered according to $_mapping

Parameters

\Horde_ActiveSync_Wbxml_Encoder $encoder

The wbxml stream encoder

Throws

\Horde_ActiveSync_Exception

isEmpty()

isEmpty() : boolean

Returns whether or not this message actually contains any data to send.

Returns

boolean —

True if message is empty, otherwise false.

_validateDecodedValues()

_validateDecodedValues() : boolean

Give concrete classes the chance to enforce rules.

Returns

boolean —

True on success, otherwise false.

_preEncodeValidation()

_preEncodeValidation() : boolean

Give concrete classes the chance to enforce rules before encoding messages to send to the client.

Returns

boolean —

True if values were valid (or could be made valid). False if values are unable to be validated.

_checkEncoding()

_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.

Parameters

mixed $data

The data to check. A string or stream resource.

string $tag

The tag we are outputing.

Returns

mixed —

The encoded data. A string or stream resource with a filter attached.

_checkSendEmpty()

_checkSendEmpty(string  $tag) : boolean

Checks to see if we should send an empty value.

Parameters

string $tag

The tag name

Returns

boolean

_getAttribute()

_getAttribute(string  $name, \stting  $default = null) : mixed

Helper method to allow default values for unset properties.

Parameters

string $name

The property name

\stting $default

The default value to return if $property is empty

Returns

mixed

_formatDate()

_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.

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.

Parameters

\Horde_Date $dt

The Horde_Date object to format (should normally be in local tz).

integer $type

The type to format as: One of TYPE_DATE or TYPE_DATE_DASHES, TYPE_DATE_LOCAL

Throws

\InvalidArgumentException

Returns

string —

The formatted date

_parseDate()

_parseDate(string  $ts) : \Horde_Date|boolean

Get a Horde_Date from a timestamp, ensuring it's in the correct format.

Used when decoding an incoming date value from the client.

Parameters

string $ts

The timestamp

Returns

\Horde_Date|boolean —

The Horde_Date or false if unable to decode.

_hex2bin()

_hex2bin(string  $data) : string

Function which converts a hex entryid to a binary entryid.

Parameters

string $data

The hexadecimal string

Returns

string —

The binary data