PHP Class Turba_Object, horde

Author: Chuck Hagenbuch ([email protected])
Author: Jon Parise ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Méthodes publiques

Свойство Type Description
$attributes array Hash of attributes for this contact.
$driver Turba_Driver Underlying driver.
$sortValue array Keeps the normalized values of sort columns.

Protected Properties

Свойство Type Description
$_emailFields array A hash with turba attribute names as key.
$_options boolean Any additional options.
$_vfs VFS Reference to this object's VFS instance.

Méthodes publiques

Méthode Description
__construct ( Turba_Driver $driver, array $attributes = [], array $options = [] ) Constructs a new Turba_Object object.
addFile ( array $info ) Saves a file into the VFS backend associated with this object.
deleteFile ( string $file ) Deletes a file from the VFS backend associated with this object.
deleteFiles ( ) Deletes all files from the VFS backend associated with this object.
getAttributes ( ) : array Returns a key-value hash containing all properties of this object.
getGuid ( string $delimiter = ':' ) : string Get a fully qualified key for this contact.
getHistory ( ) : array Returns history information about this contact.
getSource ( ) Returns the name of the address book that this object is from.
getValue ( string $attribute ) : mixed Returns the value of the specified attribute.
hasPermission ( integer $perm ) : boolean Returns whether or not the current user has the requested permission.
hasValue ( string $attribute ) : boolean Determines whether or not the object has a value for the specified attribute.
isEditable ( ) : boolean Returns true if this object is editable by the current user.
isGroup ( ) : boolean Returns true if this object is a group of multiple contacts.
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.
listFiles ( ) : array Returns all files from the VFS backend associated with this object.
merge ( Turba_Object $contact ) Merges another contact into this one by filling empty fields of this contact with values from the other.
setValue ( string $attribute, string $value ) Sets the value of the specified attribute.
store ( ) Saves the current state of the object to the storage backend.
synchronizeTags ( array $tags ) Syncronizes tags from the tagging backend with the contacts storage backend, if necessary.
url ( string $view = null, boolean $full = false ) : string Contact url.
vfsDisplayUrl ( string $file ) : string Returns a link to display and download a file from the VFS backend associated with this object.
vfsEditUrl ( string $file ) : string Returns a link to display, download, and delete a file from the VFS backend associated with this object.
vfsInit ( ) : Horde_Vfs Loads the VFS configuration and initializes the VFS backend.

Méthodes protégées

Méthode Description
_ensureEmail ( ) Ensures we have an email address set, if available.

Method Details

__construct() public méthode

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

_ensureEmail() protected méthode

Needed to cover the case where a contact might have been imported via vCard with email 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.
protected _ensureEmail ( )

addFile() public méthode

Saves a file into the VFS backend associated with this object.
public addFile ( array $info )
$info array A hash with the file information as returned from a Horde_Form_Type_file.

deleteFile() public méthode

Deletes a file from the VFS backend associated with this object.
public deleteFile ( string $file )
$file string The file name.

deleteFiles() public méthode

Deletes all files from the VFS backend associated with this object.
public deleteFiles ( )

getAttributes() public méthode

Returns a key-value hash containing all properties of this object.
public getAttributes ( ) : array
Résultat array All properties of this object.

getGuid() public méthode

Get a fully qualified key for this contact.
public getGuid ( string $delimiter = ':' ) : string
$delimiter string Delimiter for the parts of the key, defaults to ':'.
Résultat string Fully qualified contact id.

getHistory() public méthode

Returns history information about this contact.
public getHistory ( ) : array
Résultat array A hash with the optional entries 'created' and 'modified' and human readable history information as the values.

getSource() public méthode

Returns the name of the address book that this object is from.
public getSource ( )

getValue() public méthode

Returns the value of the specified attribute.
public getValue ( string $attribute ) : mixed
$attribute string The attribute to retrieve.
Résultat mixed The value of $attribute, an array (for photo type) or the empty string.

hasPermission() public méthode

Returns whether or not the current user has the requested permission.
public hasPermission ( integer $perm ) : boolean
$perm integer The permission to check.
Résultat boolean True if user has the permission.

hasValue() public méthode

Determines whether or not the object has a value for the specified attribute.
public hasValue ( string $attribute ) : boolean
$attribute string The attribute to check.
Résultat boolean Whether or not there is a value for $attribute.

isEditable() public méthode

Returns true if this object is editable by the current user.
public isEditable ( ) : boolean
Résultat boolean Whether or not the current user can edit this object

isGroup() public méthode

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

lastModification() public méthode

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.
public lastModification ( ) : integer
Résultat integer The timestamp of the last modification or zero.

listFiles() public méthode

Returns all files from the VFS backend associated with this object.
public listFiles ( ) : array
Résultat array A list of hashes with file informations.

merge() public méthode

Merges another contact into this one by filling empty fields of this contact with values from the other.
public merge ( Turba_Object $contact )
$contact Turba_Object Another contact.

setValue() public méthode

Sets the value of the specified attribute.
public setValue ( string $attribute, string $value )
$attribute string The attribute to set.
$value string The value of $attribute.

store() public méthode

Saves the current state of the object to the storage backend.
public store ( )

synchronizeTags() public méthode

Syncronizes tags from the tagging backend with the contacts storage backend, if necessary.
public synchronizeTags ( array $tags )
$tags array Tags from the tagging backend.

url() public méthode

Contact url.
public url ( string $view = null, boolean $full = false ) : string
$view string The view for the url
$full boolean Generate a full url?
Résultat string

vfsDisplayUrl() public méthode

Returns a link to display and download a file from the VFS backend associated with this object.
public vfsDisplayUrl ( string $file ) : string
$file string The file name.
Résultat string The HTML code of the generated link.

vfsEditUrl() public méthode

Returns a link to display, download, and delete a file from the VFS backend associated with this object.
public vfsEditUrl ( string $file ) : string
$file string The file name.
Résultat string The HTML code of the generated link.

vfsInit() public méthode

Loads the VFS configuration and initializes the VFS backend.
public vfsInit ( ) : Horde_Vfs
Résultat Horde_Vfs A VFS object.

Property Details

$_emailFields protected_oe property

A hash with turba attribute names as key.
protected array $_emailFields
Résultat array

$_options protected_oe property

Any additional options.
protected bool $_options
Résultat boolean

$_vfs protected_oe property

Reference to this object's VFS instance.
protected VFS $_vfs
Résultat VFS

$attributes public_oe property

Hash of attributes for this contact.
public array $attributes
Résultat array

$driver public_oe property

Underlying driver.
public Turba_Driver $driver
Résultat Turba_Driver

$sortValue public_oe property

Keeps the normalized values of sort columns.
public array $sortValue
Résultat array