Methods summary
public
Horde_ActiveSync_State_Base
|
#
__construct( array $params = array() )
Const'r
Parameters
- $params
- $collection A collection array
Returns
|
public
|
|
public
|
#
setNewSyncKey( string $newKey )
Update the $oldKey syncState to $newKey.
Update the $oldKey syncState to $newKey.
Parameters
|
public
string
|
#
getCurrentSyncKey( )
Get the current synckey
Returns
string The synkey we last retrieved state for
|
public
unknown
|
#
generatePolicyKey( )
Generate a random 10 digit policy key
Generate a random 10 digit policy key
Returns
unknown
|
public
integer
|
#
getPolicyKey( string $devId )
Obtain the current policy key, if it exists.
Obtain the current policy key, if it exists.
Parameters
- $devId
- The device id to obtain policy key for.
Returns
integer The current policy key for this device, or 0 if none
exists.
|
public
integer
|
#
getDeviceRWStatus( string $devId )
Return a device wipe status
Return a device wipe status
Parameters
Returns
integer
|
public
|
#
setBackend( Horde_ActiveSync_Driver_Base $backend )
Set the backend driver
(should really only be called by a backend object when passing this
object to client code)
Set the backend driver
(should really only be called by a backend object when passing this
object to client code)
Parameters
- $backend
- The backend driver
|
public
|
#
init( array $collection = array() )
Initialize the state object
Initialize the state object
Parameters
- $collection
- The collection array
|
public
|
#
setLogger( Horde_Log_Logger $logger )
Set the logger instance for this object.
Set the logger instance for this object.
Parameters
|
public
|
#
resetPingState( )
Reset the device's PING state.
Reset the device's PING state.
|
public
integer
|
#
getChangeCount( )
Get the number of server changes.
Get the number of server changes.
Returns
integer
|
public static
string
|
#
getNewSyncKey( string $syncKey )
Gets the new sync key for a specified sync key. You must save the new
sync state under this sync key when done sync'ing by calling
setNewSyncKey(), then save().
Gets the new sync key for a specified sync key. You must save the new
sync state under this sync key when done sync'ing by calling
setNewSyncKey(), then save().
Parameters
Returns
string The new synckey
Throws
|
public static
mixed
|
#
getSyncKeyCounter( mixed $syncKey )
Return the counter for the specified syncKey.
Return the counter for the specified syncKey.
Returns
mixed integer|boolean
|
public static
unknown_type
|
#
RowCmp( mixed $a, mixed $b )
Helper function for the _diff method
Helper function for the _diff method
Parameters
Returns
unknown_type
|
abstract public
array
|
#
loadState( string $syncKey, string $type = null, string $id = '' )
Loads the initial state from storage for the specified syncKey and
intializes the stateMachine for use.
Loads the initial state from storage for the specified syncKey and
intializes the stateMachine for use.
Parameters
- $syncKey
- The key for the state to load.
- $type
- Treat the loaded state data as this type of state.
- $id
- The collection id this represents
Returns
array The state array
|
abstract public
|
#
initPingState( object $device )
Load/initialize the ping state for the specified device.
Load/initialize the ping state for the specified device.
Parameters
|
abstract public
|
#
loadPingCollectionState( string $devid )
Load the ping state for the given device id
Load the ping state for the given device id
Parameters
|
abstract public
array
|
#
getKnownFolders( )
Get the list of known folders for the specified syncState
Get the list of known folders for the specified syncState
Returns
array An array of server folder ids
|
abstract public
|
#
save( )
Save the current syncstate to storage
Save the current syncstate to storage
|
abstract public
|
#
updateState( string $type, array $change, integer $origin = Horde_ActiveSync::CHANGE_ORIGIN_NA , string $user = null )
Update the state to reflect changes
Update the state to reflect changes
Parameters
- $type
- The type of change (change, delete, flags)
- $change
- A stat/change hash describing the change
- $origin
- Flag to indicate the origin of the change.
- $user
- The current synch user
|
abstract public
boolean
|
#
setFolderData( object $device, array $folders )
Save folder data for a specific device. This is needed for BC with older
activesync versions that use GETHIERARCHY requests to get the folder info
instead of maintaining the folder state with FOLDERSYNC requests.
Save folder data for a specific device. This is needed for BC with older
activesync versions that use GETHIERARCHY requests to get the folder info
instead of maintaining the folder state with FOLDERSYNC requests.
Parameters
- $device
- The device object
- $folders
- The folder data
Returns
boolean
Throws
|
abstract public
mixed
|
#
getFolderData( object $device, string $class )
Get the folder data for a specific device
Get the folder data for a specific device
Parameters
- $device
- The device object
- $class
- The folder class to fetch (Calendar, Contacts etc.)
Returns
mixed Either an array of folder data || false
|
abstract public
array
|
#
getChanges( integer $flags = 0 )
Get all items that have changed since the last sync time
Get all items that have changed since the last sync time
Parameters
Returns
array
|
abstract public
boolean
|
#
isConflict( array $stat, string $type )
Determines if the server version of the message represented by $stat
conflicts with the PIM version of the message according to the current
state.
Determines if the server version of the message represented by $stat
conflicts with the PIM version of the message according to the current
state.
Parameters
- $stat
- A message stat array
- $type
- The type of change (change, delete, add)
Returns
boolean
|
abstract public
|
#
setPolicyKey( string $devId, integer $key )
Save a new device policy key to storage.
Save a new device policy key to storage.
Parameters
- $devId
- The device id
- $key
- The new policy key
|
abstract public
|
#
resetAllPolicyKeys( )
Reset ALL device policy keys. Used when server policies have changed
and you want to force ALL devices to pick up the changes. This will
cause all devices that support provisioning to be reprovisioned.
Reset ALL device policy keys. Used when server policies have changed
and you want to force ALL devices to pick up the changes. This will
cause all devices that support provisioning to be reprovisioned.
Throws
|
abstract public
boolean
|
#
setDeviceRWStatus( string $devid, string $status )
Set a new remotewipe status for the device
Set a new remotewipe status for the device
Parameters
Returns
boolean
|
abstract public
StdClass
|
#
loadDeviceInfo( object $device, string $user )
Obtain the device object.
Obtain the device object.
Parameters
Returns
StdClass
|
abstract public
boolean
|
#
deviceExists( string $devId, string $user = null )
Check that a given device id is known to the server. This is regardless
of Provisioning status.
Check that a given device id is known to the server. This is regardless
of Provisioning status.
Parameters
- $devId
- The device id to check
- $user
- The device should be owned by this user.
Returns
boolean
|
abstract public
boolean
|
#
setDeviceInfo( object $data )
Set new device info
Parameters
- $data
- $device The device information
Returns
boolean
|
abstract public
|
#
removeState( string $synckey = null, string $devId = null )
Explicitly remove a state from storage.
Explicitly remove a state from storage.
Parameters
- $synckey
- The specific state to remove
- $devId
- Remove all state for this device (ignores synckey)
Throws
Horde_ActiveSyncException
|
abstract public
integer
|
#
getHeartbeatInterval( )
Return the heartbeat interval, or zero if we have no existing state
Return the heartbeat interval, or zero if we have no existing state
Returns
integer The hearbeat interval, or zero if not found.
Throws
|
abstract public
|
#
setHeartbeatInterval( integer $heartbeat )
Set the device's heartbeat interval
Set the device's heartbeat interval
Parameters
- $heartbeat
- The interval (in seconds).
|
abstract public
array
|
#
listDevices( )
List all devices that we know about.
List all devices that we know about.
Returns
array An array of device hashes
Throws
|
abstract public
integer
|
#
getLastSyncTimestamp( )
Get the last time the currently loaded device issued a SYNC request.
Get the last time the currently loaded device issued a SYNC request.
Returns
integer The timestamp of the last sync, regardless of collection
Throws
|