\SyncContext
A sync context allows you to define different rules for different settings.
For example, you might send a different subset of data and have different
security restrictions for an iphone application vs. a management portal.
- Author: Mark Guinn <mark@adaircreative.com>
Synopsis
class SyncContext
{
- // members
- protected static array $instances = ;
- protected $modelConfig;
- // methods
- public static SyncContext add()
- public static SyncContext get()
- public static SyncContext current()
- public static string current_id()
- public void __construct()
- public array getConfig()
- public void checkAuth()
- public array getFilterVariables()
Members
protected
-
$instances
cache of instances keyed by id's - $modelConfig — array
Methods
public
- __construct() — Creates a new syncing context
- add() — Adds a context to the available options. Can pass an array or an instance.
- checkAuth() — this is just a hook to be overridden if special authentication is required
- current() — Returns the actual instance of the current context if appropriate (or null)
- current_id() — Returns the 'id' of the current context or null if we're not currently doing a sync action
- get() — Returns an instance from an id
- getConfig() — Returns a merging of the model's default syncing configuration and the context configuration for this model
- getFilterVariables() — Returns an array where the keys are "variables" such as {StoreID} that can be used in the filter section of the cfg