PHP Class Turba_Object, horde

Author: Chuck Hagenbuch ([email protected])
Author: Jon Parise ([email protected])
ファイルを表示 Open project: horde/horde Class Usage Examples

Public Properties

Property 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

Property 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.

Public Methods

Method 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.

Protected Methods

Method Description
_ensureEmail ( ) Ensures we have an email address set, if available.

Method Details

__construct() public method

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 method

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 method

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 method

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

deleteFiles() public method

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

getAttributes() public method

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

getGuid() public method

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

getHistory() public method

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

getSource() public method

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

getValue() public method

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

hasPermission() public method

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

hasValue() public method

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

isEditable() public method

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

isGroup() public method

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

lastModification() public method

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
return integer The timestamp of the last modification or zero.

listFiles() public method

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

merge() public method

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 method

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 method

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

synchronizeTags() public method

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 method

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

vfsDisplayUrl() public method

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.
return string The HTML code of the generated link.

vfsEditUrl() public method

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.
return string The HTML code of the generated link.

vfsInit() public method

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

Property Details

$_emailFields protected_oe property

A hash with turba attribute names as key.
protected array $_emailFields
return array

$_options protected_oe property

Any additional options.
protected bool $_options
return boolean

$_vfs protected_oe property

Reference to this object's VFS instance.
protected VFS $_vfs
return VFS

$attributes public_oe property

Hash of attributes for this contact.
public array $attributes
return array

$driver public_oe property

Underlying driver.
public Turba_Driver $driver
return Turba_Driver

$sortValue public_oe property

Keeps the normalized values of sort columns.
public array $sortValue
return array