PHP Class Turba_Object_Group, horde

Author: Chuck Hagenbuch ([email protected])
Author: Jon Parise ([email protected])
Inheritance: extends Turba_Object
Datei anzeigen Open project: horde/horde Class Usage Examples

Public Methods

Method Description
__construct ( Turba_Driver $driver, array $attributes = [], array $options = [] ) Constructs a new Turba_Object_Group.
addMember ( string $contactId, string $sourceId = null ) Adds a new contact entry to this group.
count ( ) : integer Count the number of contacts in this group.
createGroup ( string $source, array $members, array $opts = [] ) : object Add members to a group, creating the group if necessary.
isGroup ( ) : boolean Returns true if this object is a group of multiple contacts.
listMembers ( array $sort = null ) : Turba_List Retrieve the Objects in this group
removeMember ( string $contactId, string $sourceId = null ) Deletes a contact from this group.
url ( $view = null, $full = false ) : Horde_Url Contact url.

Protected Methods

Method Description
_ensureEmail ( )

Method Details

__construct() public method

Constructs a new Turba_Object_Group.
public __construct ( Turba_Driver $driver, array $attributes = [], array $options = [] )
$driver Turba_Driver The driver object that this group comes from.
$attributes array Hash of attributes for this group.
$options array Hash of options for this object. @since Turba 4.2

_ensureEmail() protected method

protected _ensureEmail ( )

addMember() public method

Adds a new contact entry to this group.
public addMember ( string $contactId, string $sourceId = null )
$contactId string The id of the contact to add.
$sourceId string The source $contactId is from.

count() public method

Count the number of contacts in this group.
public count ( ) : integer
return integer

createGroup() public static method

Add members to a group, creating the group if necessary.
public static createGroup ( string $source, array $members, array $opts = [] ) : object
$source string Destination source.
$members array Members of the group. Array of two-element arrays: source and key.
$opts array 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.
return object 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.

isGroup() public method

Returns true if this object is a group of multiple contacts.
public isGroup ( ) : boolean
return boolean True.

listMembers() public method

Retrieve the Objects in this group
public listMembers ( array $sort = null ) : Turba_List
$sort array The requested sort order which is passed to Turba_List::sort().
return Turba_List List containing the members of this group

removeMember() public method

Deletes a contact from this group.
public removeMember ( string $contactId, string $sourceId = null )
$contactId string The id of the contact to remove.
$sourceId string The source $contactId is from.

url() public method

Contact url.
public url ( $view = null, $full = false ) : Horde_Url
return Horde_Url