The Turba_Object:: class provides a base implementation for Turba
objects - people, groups, restaurants, etc.
Methods summary
public
|
#
__construct( Turba_Driver $driver, array $attributes = array() )
Constructs a new Turba_Object object.
Constructs a new Turba_Object object.
Parameters
- $driver
- The source that this object came from.
- $attributes
- Hash of attributes for this object.
|
public
array
|
#
getAttributes( )
Returns a key-value hash containing all properties of this object.
Returns a key-value hash containing all properties of this object.
Returns
array All properties of this object.
|
public
|
#
getSource( )
Returns the name of the address book that this object is from.
Returns the name of the address book that this object is from.
|
public
string
|
#
getGuid( string $delimiter = ':' )
Get a fully qualified key for this contact.
Get a fully qualified key for this contact.
Parameters
- $delimiter
- Delimiter for the parts of the key, defaults to ':'.
Returns
string Fully qualified contact id.
|
public
mixed
|
#
getValue( string $attribute )
Returns the value of the specified attribute.
Returns the value of the specified attribute.
Parameters
- $attribute
- The attribute to retrieve.
Returns
mixed The value of $attribute, an array (for photo type)
or the empty string.
|
public
|
#
setValue( string $attribute, string $value )
Sets the value of the specified attribute.
Sets the value of the specified attribute.
Parameters
- $attribute
- The attribute to set.
- $value
- The value of $attribute.
|
public
boolean
|
#
hasValue( string $attribute )
Determines whether or not the object has a value for the specified
attribute.
Determines whether or not the object has a value for the specified
attribute.
Parameters
- $attribute
- The attribute to check.
Returns
boolean Whether or not there is a value for $attribute.
|
public
integer
|
#
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.
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.
Returns
integer The timestamp of the last modification or zero.
|
public
|
#
merge( Turba_Object $contact )
Merges another contact into this one by filling empty fields of this
contact with values from the other.
Merges another contact into this one by filling empty fields of this
contact with values from the other.
Parameters
- $contact
- Another contact.
|
public
array
|
#
getHistory( )
Returns history information about this contact.
Returns history information about this contact.
Returns
array A hash with the optional entries 'created' and 'modified'
and human readable history information as the values.
|
public
boolean
|
#
isGroup( )
Returns true if this object is a group of multiple contacts.
Returns true if this object is a group of multiple contacts.
Returns
boolean True if this object is a group of multiple contacts.
|
public
boolean
|
#
isEditable( )
Returns true if this object is editable by the current user.
Returns true if this object is editable by the current user.
Returns
boolean Whether or not the current user can edit this object
|
public
boolean
|
#
hasPermission( integer $perm )
Returns whether or not the current user has the requested permission.
Returns whether or not the current user has the requested permission.
Parameters
- $perm
- The permission to check.
Returns
boolean True if user has the permission.
|
public
string
|
#
url( string $view = null, boolean $full = false )
Contact url.
Parameters
- $view
- The view for the url
- $full
- Generate a full url?
Returns
string
|
public
|
#
addFile( array $info )
Saves a file into the VFS backend associated with this object.
Saves a file into the VFS backend associated with this object.
Parameters
- $info
- <p>A hash with the file information as returned from a
Horde_Form_Type_file.</p>
Throws
|
public
|
#
deleteFile( string $file )
Deletes a file from the VFS backend associated with this object.
Deletes a file from the VFS backend associated with this object.
Parameters
Throws
|
public
|
#
deleteFiles( )
Deletes all files from the VFS backend associated with this object.
Deletes all files from the VFS backend associated with this object.
Throws
|
public
array
|
#
listFiles( )
Returns all files from the VFS backend associated with this object.
Returns all files from the VFS backend associated with this object.
Returns
array A list of hashes with file informations.
|
public
string
|
#
vfsDisplayUrl( string $file )
Returns a link to display and download a file from the VFS backend
associated with this object.
Returns a link to display and download a file from the VFS backend
associated with this object.
Parameters
Returns
string The HTML code of the generated link.
|
public
string
|
#
vfsEditUrl( string $file )
Returns a link to display, download, and delete a file from the VFS
backend associated with this object.
Returns a link to display, download, and delete a file from the VFS
backend associated with this object.
Parameters
Returns
string The HTML code of the generated link.
|
public
|
#
store( )
Saves the current state of the object to the storage backend.
Saves the current state of the object to the storage backend.
Throws
|