class Horde_ActiveSync_Driver_Horde_Connector_Registry
{
/**
+ * Horde registry intance
+ *
* @var Horde_Registry
*/
private $_registry;
/**
* Const'r
*
+ * @param array $params Configuration parameters. Requires:
+ * <pre>
+ * 'registry' - An instance of Horde_Registry
+ * </pre>
+ *
+ * @return Horde_ActiveSync_Driver_Horde_Connector_Registry
*/
public function __construct($params = array())
{
*
* @param string $action The action to check for (add, modify, delete)
* @param timestamp $from_ts The timestamp to start checking from
- * @param string $calendar
+ * @param string $calendar The calendar to limit results to
+ *
+ * @return array An array of event uids
*/
public function calendar_listBy($action, $from_ts, $calendar = null)
{
* Export the specified calendar in the specified content type
*
* @param string $uid The calendar id
- * @param string $contentType The content type specifier
*
* @return The iCalendar representation of the calendar
*/
public function calendar_export($uid)
{
- $result = $this->_registry->calendar->export($uid, 'activesync');
- return $result;
+ return $this->_registry->calendar->export($uid, 'activesync');
}
/**
* Import an event into Horde's calendar store.
*
- * @param Horde_ActiveSync_Message_Appointmetn $content The event content
- * @param string $contentType The content type of $content
+ * @param Horde_ActiveSync_Message_Appointment $content The event content
* @param string $calendar The calendar to import event into
*
* @return string The event's UID
}
/**
- * Replcae the event with new data
+ * Replace the event with new data
*
- * @param string $uid The UID of the event to replace
- * @param string $content The new event content
- * @param string $contentType The content type of $content
+ * @param string $uid The UID of the event to replace
+ * @param Horde_ActiveSync_Message_Appointment $content The new event content
*
* @return boolean
*/
public function calendar_replace($uid, $content)
{
- $result = $this->_registry->calendar->replace($uid, $content, 'activesync');
- return $result;
+ return $this->_registry->calendar->replace($uid, $content, 'activesync');
}
/**
*/
public function calendar_delete($uid)
{
- $result = $this->_registry->calendar->delete($uid);
- return $result;
+ return $this->_registry->calendar->delete($uid);
}
/**
*/
public function calendar_getActionTimestamp($uid, $action)
{
- $result = $this->_registry->calendar->getActionTimestamp($uid, $action);
- return $result;
+ return $this->_registry->calendar->getActionTimestamp($uid, $action);
}
/**
*/
public function contacts_list()
{
- $result = $this->_registry->contacts->listContacts();
- return $result;
+ return $this->_registry->contacts->listContacts();
}
/**
* Export the specified contact from Horde's contacts storage
*
* @param string $uid The contact's UID
- * @param string $contentType The content type to export in
- * (text/directory text/vcard text/x-vcard)
*
- * @return the contact in the requested content type
+ * @return array The contact hash
*/
- public function contacts_export($uid, $contentType)
+ public function contacts_export($uid)
{
- $result = $this->_registry->contacts->export($uid, $contentType);
- return $result;
+ return $this->_registry->contacts->export($uid, 'array');
}
/**
* Import the provided contact data into Horde's contacts storage
*
* @param string $content The contact data
- * @param string $contentType The content type specifier of $content
* @param string $source The contact source to import to
*
* @return boolean
*/
- public function contacts_import($content, $contentType, $import_source = null)
+ public function contacts_import($content, $import_source = null)
{
- $result = $this->_registry->contacts->import($content, $contentType, $import_source);
- return $result;
+ return $this->_registry->contacts->import($content, 'array', $import_source);
}
/**
*
* @param string $uid The UID of the contact to replace
* @param string $content The contact data
- * @param string $contentType The content type of $content
* @param string $sources The sources where UID will be replaced
*
* @return boolean
*/
- public function contacts_replace($uid, $content, $contentType, $sources = null)
+ public function contacts_replace($uid, $content, $sources = null)
{
- $result = $this->_registry->contacts->replace($uid, $content, $contentType, $sources);
- return $result;
+ return $this->_registry->contacts->replace($uid, $content, 'array', $sources);
}
/**
*/
public function contacts_delete($uid)
{
- $result = $this->_registry->contacts->delete($uid);
- return $result;
+ return $this->_registry->contacts->delete($uid);
}
/**
*/
public function contacts_getActionTimestamp($uid, $action)
{
- $result = $this->_registry->contacts->getActionTimestamp($uid, $action);
- return $result;
+ return $this->_registry->contacts->getActionTimestamp($uid, $action);
}
+ /**
+ * List all tasks in the user's default tasklist.
+ *
+ * @return array An array of task uids.
+ */
public function tasks_listTasks()
{
$app = $this->horde_hasInterface('tasks');
return $this->_registry->tasks->listTaskUids($tasklist);
}
+ /**
+ * Export a single task from the backend.
+ *
+ * @param string $uid The task uid
+ *
+ * @return Horde_ActiveSync_Message_Task The task message object
+ */
public function tasks_export($uid)
{
return $this->_registry->tasks->export($uid, 'activesync');
}
+ /**
+ * Importa a single task into the backend.
+ *
+ * @param Horde_ActiveSync_Message_Task $message The task message object
+ *
+ * @return string The newly added task's uid.
+ */
public function tasks_import($message)
{
return $this->_registry->tasks->import($message, 'activesync');
}
+ /**
+ * Replace an existing task with the provided task.
+ *
+ * @param string $uid The existing tasks's uid
+ * @param Horde_ActiveSync_Message_Task $message The task object
+ *
+ * @return boolean
+ */
public function tasks_replace($uid, $message)
{
return $this->_registry->tasks->replace($uid, $message, 'activesync');
}
+ /**
+ * Delete a task from the backend.
+ *
+ * @param string $id The task's uid
+ *
+ * @return boolean
+ */
public function tasks_delete($id)
{
return $this->_registry->tasks->delete($id);
}
+ /**
+ * Return the timestamp for the last time $action was performed.
+ *
+ * @param string $uid The UID of the task we are interested in.
+ * @param string $action The action we are interested in (add, modify...)
+ *
+ * @return timestamp
+ */
public function tasks_getActionTimestamp($uid, $action)
{
return $this->_registry->tasks->getActionTimestamp($uid, $action);
}
+ /**
+ * Return all active api interfaces.
+ *
+ * @return array An array of interface names.
+ */
public function horde_listApis()
{
return $this->_registry->horde->listAPIs();
}
+ /**
+ * Obtain a user's preference setting.
+ *
+ * @param string $app The Horde application providing the setting.
+ * @param string $pref The name of the preference setting.
+ *
+ * @return mixed The preference value
+ */
public function horde_getPref($app, $pref)
{
return $this->_registry->horde->getPreference($app, $pref);
}
+ /**
+ * Obtain the name of the Horde application that provides the specified api
+ * interface.
+ *
+ * @param string $api The interface name
+ *
+ * @return string The application name.
+ */
public function horde_hasInterface($api)
{
return $this->_registry->hasInterface($api);