Class LdapEntry

Description

LDAP entry class

Representation of an LDAP entry, composed by a DN (distinguished name) and a set of attributes.

Located in /core/net/ldap/LdapEntry.class.php (line 41)

PHP2Go
   |
   --LdapEntry
Variable Summary
array $attrs
array $changes
string $dn
array $original
Method Summary
static LdapEntry createFromResult (resource &$conn, resource &$entry)
LdapEntry LdapEntry (string $dn, [array $attrs = array()])
void addValues (string $attr, array $values)
void confirmChanges ()
mixed getAttribute (string $name, [mixed $fallback = NULL])
array getAttributes ()
array &getChanges ()
string getDN ()
bool hasAttribute (string $name)
array|FALSE matchAttribute (string $name, string $pattern)
void removeAttribute (string $name)
void removeValues (string $attr, array $values)
void setAttribute (string $name, mixed $value)
void setDN (string $dn)
void toArray ()
mixed __get (string $prop)
void __set (string $prop, mixed $value)
Variables
array $attrs = array() (line 56)

Entry attributes

  • access: private
array $changes = array(
'dn' => NULL,
'add' => array(),'replace'=>array(),'delete'=>array())
(line 63)

Attribute changes

  • access: private
string $dn = '' (line 49)

Entry DN

  • access: private
array $original = array() (line 75)

Original attribute values

  • access: private
Methods
static method createFromResult (line 103)

Parses an entry from a search result

Creates an LdapEntry instance based on a connection handle and an entry handle, commonly returned by ldap_first_entry() and ldap_next_entry() functions.

static LdapEntry createFromResult (resource &$conn, resource &$entry)
  • resource &$conn: LDAP connection handle
  • resource &$entry: LDAP entry handle
Constructor LdapEntry (line 84)

Class constructor

LdapEntry LdapEntry (string $dn, [array $attrs = array()])
  • string $dn: Entry DN
  • array $attrs: Entry attributes
addValues (line 280)

Adds new values to an entry's attribute

If the attribute doesn't exist, it will be created.

void addValues (string $attr, array $values)
  • string $attr: Attribute name
  • array $values: New values
confirmChanges (line 380)

Confirm changes

Used by LdapClient::update() to reset internal entry changes after a successful update operation.

void confirmChanges ()
getAttribute (line 196)

Reads the value of an attribute

mixed getAttribute (string $name, [mixed $fallback = NULL])
  • string $name: Attribute name
  • mixed $fallback: Fallback return value
getAttributes (line 168)

Get all attributes

array getAttributes ()
getChanges (line 369)

Get all changes made so far

array &getChanges ()
getDN (line 147)

Get entry DN

string getDN ()
hasAttribute (line 185)

Checks if a given attribute exists

bool hasAttribute (string $name)
  • string $name: Attribute name
matchAttribute (line 209)

Tests a given attribute against a regular expression pattern

  • return: Result matches or FALSE in case of failure
array|FALSE matchAttribute (string $name, string $pattern)
  • string $name: Attribute name
  • string $pattern: Pattern
removeAttribute (line 258)

Removes an attribute

void removeAttribute (string $name)
  • string $name: Attribute name
removeValues (line 324)

Removes values from an entry's attribute

If all values are removed, the attribute is removed.

void removeValues (string $attr, array $values)
  • string $attr: Attribute name
  • array $values: Values to remove
setAttribute (line 229)

Writes an attribute

void setAttribute (string $name, mixed $value)
  • string $name: Attribute name
  • mixed $value: Attribute value
setDN (line 156)

Set entry DN

void setDN (string $dn)
  • string $dn: New entry DN
toArray (line 393)

Implements data set row interface

void toArray ()
__get (line 128)

Attribute getter

mixed __get (string $prop)
  • string $prop: Property name
__set (line 138)

Attribute setter

void __set (string $prop, mixed $value)
  • string $prop: Property name
  • mixed $value: Property value

Inherited Methods

Inherited From PHP2Go

PHP2Go::PHP2Go()
PHP2Go::equals()
PHP2Go::generateUniqueId()
PHP2Go::getClassName()
PHP2Go::getConfigVal()
PHP2Go::getLangVal()
PHP2Go::getObjectName()
PHP2Go::getParentName()
PHP2Go::hasDestructor()
PHP2Go::hashCode()
PHP2Go::isA()
PHP2Go::isSubclassOf()
PHP2Go::logError()
PHP2Go::raiseError()
PHP2Go::registerDestructor()
PHP2Go::registerShutdownFunc()
PHP2Go::retrieve()
PHP2Go::store()
PHP2Go::__toString()

Documentation generated on Sun, 07 Oct 2007 19:27:11 -0300 by phpDocumentor 1.3.2