PHP 클래스 Horde_Prefs_Identity, horde

저자: Jan Schneider ([email protected])
상속: implements ArrayAccess, implements Countable, implements IteratorAggregate
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_default integer This one is used by the methods returning values if no other one is specified.
$_identities array Array containing all the user's identities.
$_prefnames array Preference names.
$_prefs Horde_Prefs The prefs object that this Identity points to.
$_user string The user whose identities these are.

공개 메소드들

메소드 설명
__construct ( array $params = [] ) Constructor.
add ( array $identity = [] ) : integer Adds a new identity to the array of identities.
count ( )
delete ( integer $identity ) : array Removes an identity from the array of identities.
get ( integer $identity = null ) : array Returns a complete identity hash.
getAll ( string $key ) : array Returns an array with the specified property from all existing identities.
getDefault ( ) : integer Returns a pointer to the current default identity.
getDefaultFromAddress ( boolean $fullname = false ) : Horde_Mail_Rfc822_Address Generates the from address to use for the default identity.
getFromAddress ( integer $ident = null ) : Horde_Mail_Rfc822_Address Returns the from address based on the chosen identity.
getIterator ( )
getName ( integer $ident = null ) : string Returns the user's full name.
getValue ( string $key, integer $identity = null ) : mixed Returns a property from one of the identities. If this value doesn't exist or is locked, the property is retrieved from the prefs backend.
hasValue ( string $key, string $value ) : boolean Returns true if the given address belongs to one of the identities.
init ( ) Creates a default identity if none exists yet and sets the preferences up if the identities are locked.
isLocked ( ) : boolean Returns true if all properties are locked and therefore nothing in the identities can be changed.
offsetExists ( $offset )
offsetGet ( $offset )
offsetSet ( $offset, $value )
offsetUnset ( $offset )
save ( ) Saves all identities in the prefs backend.
setDefault ( integer $identity ) : boolean Sets the current default identity.
setValue ( string $key, mixed $val, integer $identity = null ) : boolean Sets a property with a specified value.
verify ( integer $identity = null ) Verifies and sanitizes all identity properties.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $params = [] )
$params array Parameters: - default_identity: (string) The preference name for the default identity. DEFAULT: 'default_identity' - from_addr: (string) The preference name for the user's from e-mail address. DEFAULT: 'from_addr' - fullname: (string) The preference name for the user's full name. DEFAULT: 'fullname' - id: (string) The preference name for the identity name. DEFAULT: 'id' - identities: (string) The preference name for the identity store. DEFAULT: 'identities' - prefs: (Horde_Prefs) [REQUIRED] The prefs object to use. - properties: (array) The list of properties for the identity. DEFAULT: array('from_addr', 'fullname', 'id') - user: (string) [REQUIRED] The user whose prefs we are handling.

add() 공개 메소드

Adds a new identity to the array of identities.
public add ( array $identity = [] ) : integer
$identity array An identity hash to add.
리턴 integer The pointer to the created identity

count() 공개 메소드

부터: 2.7.0
public count ( )

delete() 공개 메소드

Removes an identity from the array of identities.
public delete ( integer $identity ) : array
$identity integer The pointer to the identity to be removed
리턴 array The removed identity.

get() 공개 메소드

Returns a complete identity hash.
public get ( integer $identity = null ) : array
$identity integer The identity to retrieve.
리턴 array An identity hash. Returns null if the identity does not exist.

getAll() 공개 메소드

Returns an array with the specified property from all existing identities.
public getAll ( string $key ) : array
$key string The property to retrieve.
리턴 array The array with the values from all identities.

getDefault() 공개 메소드

Returns a pointer to the current default identity.
public getDefault ( ) : integer
리턴 integer The pointer to the current default identity.

getDefaultFromAddress() 공개 메소드

Generates the from address to use for the default identity.
public getDefaultFromAddress ( boolean $fullname = false ) : Horde_Mail_Rfc822_Address
$fullname boolean Include the fullname information.
리턴 Horde_Mail_Rfc822_Address The default from address (object returned since 2.2.0).

getFromAddress() 공개 메소드

If no address can be found it is built from the current user.
public getFromAddress ( integer $ident = null ) : Horde_Mail_Rfc822_Address
$ident integer The identity to retrieve the address from.
리턴 Horde_Mail_Rfc822_Address A valid from address.

getIterator() 공개 메소드

부터: 2.7.0
public getIterator ( )

getName() 공개 메소드

Returns the user's full name.
public getName ( integer $ident = null ) : string
$ident integer The identity to retrieve the name from.
리턴 string The user's full name, or the user name if it doesn't exist.

getValue() 공개 메소드

Returns a property from one of the identities. If this value doesn't exist or is locked, the property is retrieved from the prefs backend.
public getValue ( string $key, integer $identity = null ) : mixed
$key string The property to retrieve.
$identity integer The identity to retrieve the property from.
리턴 mixed The value of the property.

hasValue() 공개 메소드

Returns true if the given address belongs to one of the identities.
public hasValue ( string $key, string $value ) : boolean
$key string The identity key to search.
$value string The value to search for in $key.
리턴 boolean True if the $value was found in $key.

init() 공개 메소드

Creates a default identity if none exists yet and sets the preferences up if the identities are locked.
public init ( )

isLocked() 공개 메소드

Returns true if all properties are locked and therefore nothing in the identities can be changed.
public isLocked ( ) : boolean
리턴 boolean True if all properties are locked, false otherwise.

offsetExists() 공개 메소드

부터: 2.7.0
public offsetExists ( $offset )

offsetGet() 공개 메소드

부터: 2.7.0
public offsetGet ( $offset )

offsetSet() 공개 메소드

부터: 2.7.0
public offsetSet ( $offset, $value )

offsetUnset() 공개 메소드

부터: 2.7.0
public offsetUnset ( $offset )

save() 공개 메소드

Saves all identities in the prefs backend.
public save ( )

setDefault() 공개 메소드

If the identity doesn't exist, the old default identity stays the same.
public setDefault ( integer $identity ) : boolean
$identity integer The pointer to the new default identity.
리턴 boolean True on success, false on failure.

setValue() 공개 메소드

Sets a property with a specified value.
public setValue ( string $key, mixed $val, integer $identity = null ) : boolean
$key string The property to set.
$val mixed The value to which the property should be set.
$identity integer The identity to set the property in.
리턴 boolean True on success, false on failure (property was locked).

verify() 공개 메소드

Verifies and sanitizes all identity properties.
public verify ( integer $identity = null )
$identity integer The identity to verify.

프로퍼티 상세

$_default 보호되어 있는 프로퍼티

This one is used by the methods returning values if no other one is specified.
protected int $_default
리턴 integer

$_identities 보호되어 있는 프로퍼티

Array containing all the user's identities.
protected array $_identities
리턴 array

$_prefnames 보호되어 있는 프로퍼티

Preference names.
protected array $_prefnames
리턴 array

$_prefs 보호되어 있는 프로퍼티

The prefs object that this Identity points to.
protected Horde_Prefs $_prefs
리턴 Horde_Prefs

$_user 보호되어 있는 프로퍼티

The user whose identities these are.
protected string $_user
리턴 string