$driver
$driver : \Turba_Driver
Underlying driver.
This class provides a set of methods for dealing with contact groups.
$driver : \Turba_Driver
Underlying driver.
__construct(\Turba_Driver $driver, array $attributes = array(), array $options = array())
Constructs a new Turba_Object_Group.
\Turba_Driver | $driver | The driver object that this group comes from. |
array | $attributes | Hash of attributes for this group. |
array | $options | Hash of options for this object. @since Turba 4.2 |
ensureAttributes()
Ensures we save attributes of a certain type to attributes of the same type but a different attribute name, if the original name didn't exist.
Needed to cover the case where a contact might have been imported via vCard with email/phone/etc TYPEs that do not match the configured attributes for this source. E.g., the vCard contains a TYPE=HOME but we only have the generic 'email' field available or vice versa.
lastModification() : integer
Returns the timestamp of the last modification, whether this was the creation or editing of the object and stores it as the attribute __modified. The value is cached for the lifetime of the object.
The timestamp of the last modification or zero.
merge(\Turba_Object $contact)
Merges another contact into this one by filling empty fields of this contact with values from the other.
\Turba_Object | $contact | Another contact. |
listMembers(array $sort = null) : \Turba_List
Retrieve the Objects in this group
array | $sort | The requested sort order which is passed to Turba_List::sort(). |
List containing the members of this group
createGroup(string $source, array $members, array $opts = array()) : object
Add members to a group, creating the group if necessary.
string | $source | Destination source. |
array | $members | Members of the group. Array of two-element arrays: source and key. |
array | $opts | Additional options: - attr: (array) Array of attributes to use to create a new group. This should include 'name' at a minimum. - gid: (string) Existing Group ID. - name: (string) Group Name. |
Object with the following properties:
- errors: (array) List of errors when adding members. - group: (Turba_Object_Group) Group object. - success: (integer) Number of members sucessfully added.