PHP Класс Turba_Object, horde

Автор: Chuck Hagenbuch ([email protected])
Автор: Jon Parise ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$attributes array Hash of attributes for this contact.
$driver Turba_Driver Underlying driver.
$sortValue array Keeps the normalized values of sort columns.

Защищенные свойства (Protected)

Свойство Тип Описание
$_emailFields array A hash with turba attribute names as key.
$_options boolean Any additional options.
$_vfs VFS Reference to this object's VFS instance.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
_ensureEmail ( ) Ensures we have an email address set, if available.

Описание методов

__construct() публичный Метод

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() защищенный Метод

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() публичный Метод

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() публичный Метод

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

deleteFiles() публичный Метод

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

getAttributes() публичный Метод

Returns a key-value hash containing all properties of this object.
public getAttributes ( ) : array
Результат array All properties of this object.

getGuid() публичный Метод

Get a fully qualified key for this contact.
public getGuid ( string $delimiter = ':' ) : string
$delimiter string Delimiter for the parts of the key, defaults to ':'.
Результат string Fully qualified contact id.

getHistory() публичный Метод

Returns history information about this contact.
public getHistory ( ) : array
Результат array A hash with the optional entries 'created' and 'modified' and human readable history information as the values.

getSource() публичный Метод

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

getValue() публичный Метод

Returns the value of the specified attribute.
public getValue ( string $attribute ) : mixed
$attribute string The attribute to retrieve.
Результат mixed The value of $attribute, an array (for photo type) or the empty string.

hasPermission() публичный Метод

Returns whether or not the current user has the requested permission.
public hasPermission ( integer $perm ) : boolean
$perm integer The permission to check.
Результат boolean True if user has the permission.

hasValue() публичный Метод

Determines whether or not the object has a value for the specified attribute.
public hasValue ( string $attribute ) : boolean
$attribute string The attribute to check.
Результат boolean Whether or not there is a value for $attribute.

isEditable() публичный Метод

Returns true if this object is editable by the current user.
public isEditable ( ) : boolean
Результат boolean Whether or not the current user can edit this object

isGroup() публичный Метод

Returns true if this object is a group of multiple contacts.
public isGroup ( ) : boolean
Результат boolean True if this object is a group of multiple contacts.

lastModification() публичный Метод

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
Результат integer The timestamp of the last modification or zero.

listFiles() публичный Метод

Returns all files from the VFS backend associated with this object.
public listFiles ( ) : array
Результат array A list of hashes with file informations.

merge() публичный Метод

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() публичный Метод

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() публичный Метод

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

synchronizeTags() публичный Метод

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() публичный Метод

Contact url.
public url ( string $view = null, boolean $full = false ) : string
$view string The view for the url
$full boolean Generate a full url?
Результат string

vfsDisplayUrl() публичный Метод

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.
Результат string The HTML code of the generated link.

vfsEditUrl() публичный Метод

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.
Результат string The HTML code of the generated link.

vfsInit() публичный Метод

Loads the VFS configuration and initializes the VFS backend.
public vfsInit ( ) : Horde_Vfs
Результат Horde_Vfs A VFS object.

Описание свойств

$_emailFields защищенное свойство

A hash with turba attribute names as key.
protected array $_emailFields
Результат array

$_options защищенное свойство

Any additional options.
protected bool $_options
Результат boolean

$_vfs защищенное свойство

Reference to this object's VFS instance.
protected VFS $_vfs
Результат VFS

$attributes публичное свойство

Hash of attributes for this contact.
public array $attributes
Результат array

$driver публичное свойство

Underlying driver.
public Turba_Driver $driver
Результат Turba_Driver

$sortValue публичное свойство

Keeps the normalized values of sort columns.
public array $sortValue
Результат array