Class Zend_Ldap_Node

Description

Implements interfaces:

  • Iterator (internal interface)
  • RecursiveIterator (internal interface)

Zend_Ldap_Node provides an object oriented view into a LDAP node.

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Ldap/Node.php (line 41)

Zend_Ldap_Node_Abstract
   |
   --Zend_Ldap_Node
Variable Summary
Method Summary
 static Zend_Ldap_Node create (string|array|Zend_Ldap_Dn $dn, [ $objectClass = array()])
 static Zend_Ldap_Node fromArray ( $data, [boolean $fromDataSource = false])
 static Zend_Ldap_Node|null fromLdap (string|array|Zend_Ldap_Dn $dn, Zend_Ldap $ldap)
 Zend_Ldap_Node __construct (Zend_Ldap_Dn $dn,  $data, boolean $fromDataSource, [Zend_Ldap $ldap = null])
 Zend_Ldap_Node appendObjectClass (array|string $value)
 Zend_Ldap_Node appendToAttribute (string $name, mixed $value)
 Zend_Ldap_Node appendToDateTimeAttribute (string $name, integer|array $value, [boolean $utc = false])
 integer countChildren ()
 integer countSubtree (string|Zend_Ldap_Filter_Abstract $filter, [integer $scope = Zend_Ldap::SEARCH_SCOPE_SUB])
 array current ()
 boolean exists ([Zend_Ldap $ldap = null])
 array getChangedData ()
 array getChanges ()
 Zend_Ldap_Node getParent ([Zend_Ldap $ldap = null])
 boolean hasChildren ()
 boolean isAttached ()
 boolean isNew ()
 string key ()
 Zend_Ldap_Node move (Zend_Ldap_Dn|string|array $newDn)
 void next ()
 null offsetSet (string $name, mixed $value)
 null offsetUnset (string $name)
 Zend_Ldap_Node reload ([Zend_Ldap $ldap = null])
 void removeDuplicatesFromAttribute (string $attribName)
 void removeFromAttribute (string $attribName, mixed|array $value)
 Zend_Ldap_Node rename (Zend_Ldap_Dn|string|array $newDn)
 void rewind ()
 Zend_Ldap_Node_Collection searchChildren (string|Zend_Ldap_Filter_Abstract $filter, [string $sort = null])
 Zend_Ldap_Node_Collection searchSubtree (string|Zend_Ldap_Filter_Abstract $filter, [integer $scope = Zend_Ldap::SEARCH_SCOPE_SUB], [string $sort = null])
 Zend_Ldap_Node setAttribute (string $name, mixed $value)
 Zend_Ldap_Node setDateTimeAttribute (string $name, integer|array $value, [boolean $utc = false])
 Zend_Ldap_Node setDn (Zend_Ldap_Dn|string|array $newDn)
 Zend_Ldap_Node setObjectClass (array|string $value)
 Zend_Ldap_Node setPasswordAttribute (string $password, [string $hashType = Zend_Ldap_Attribute::PASSWORD_HASH_MD5], [string $attribName = 'userPassword'])
 string toLdif ([ $options = array()])
 Zend_Ldap_Node update ([Zend_Ldap $ldap = null])
 boolean valid ()
 boolean willBeDeleted ()
 boolean willBeMoved ()
 boolean _assertChangeableAttribute (string $name)
 void _loadData ( $data, boolean $fromDataSource)
 void _markAsNew (boolean $new)
 void _markAsToBeDeleted (boolean $delete)
 void _setAttribute (string $name, mixed $value, boolean $append)
 void _setDateTimeAttribute (string $name, integer|array $value, boolean $utc, boolean $append)
 null __set (string $name, mixed $value)
 array __sleep ()
 null __unset (string $name)
 null __wakeup ()
Variables
array $_children (line 79)

Holds an array of the current node's children.

  • access: protected
boolean $_delete (line 66)

This node will be deleted

  • access: protected
Zend_Ldap $_ldap (line 72)

Holds the connection to the LDAP server if in connected mode.

  • access: protected
boolean $_new (line 60)

This node will be added

  • access: protected
Zend_Ldap_Dn $_newDn (line 48)

Holds the node's new DN if node is renamed.

  • access: protected
array $_originalData (line 54)

Holds the node's orginal attributes (as loaded).

  • access: protected

Inherited Variables

Inherited from Zend_Ldap_Node_Abstract

Zend_Ldap_Node_Abstract::$_currentData
Zend_Ldap_Node_Abstract::$_dn
Zend_Ldap_Node_Abstract::$_systemAttributes
Methods
static create (line 237)

Factory method to create a new detached Zend_Ldap_Node for a given DN.

  • throws: Zend_Ldap_Exception
  • access: public
static Zend_Ldap_Node create (string|array|Zend_Ldap_Dn $dn, [ $objectClass = array()])
static fromArray (line 293)

Factory method to create a detached Zend_Ldap_Node from array data.

  • throws: Zend_Ldap_Exception
  • access: public
static Zend_Ldap_Node fromArray ( $data, [boolean $fromDataSource = false])
  • array $data
  • boolean $fromDataSource
static fromLdap (line 264)

Factory method to create an attached Zend_Ldap_Node for a given DN.

  • throws: Zend_Ldap_Exception
  • access: public
static Zend_Ldap_Node|null fromLdap (string|array|Zend_Ldap_Dn $dn, Zend_Ldap $ldap)
Constructor __construct (line 99)

Constructor.

Constructor is protected to enforce the use of factory methods.

  • throws: Zend_Ldap_Exception
  • access: protected
Zend_Ldap_Node __construct (Zend_Ldap_Dn $dn,  $data, boolean $fromDataSource, [Zend_Ldap $ldap = null])

Redefinition of:
Zend_Ldap_Node_Abstract::__construct()
Constructor.
appendObjectClass (line 560)

Appends to the objectClass.

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node appendObjectClass (array|string $value)
  • array|string $value
appendToAttribute (line 660)

Appends to a LDAP attribute.

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node appendToAttribute (string $name, mixed $value)
  • string $name
  • mixed $value
appendToDateTimeAttribute (line 708)

Appends to a LDAP date/time attribute.

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node appendToDateTimeAttribute (string $name, integer|array $value, [boolean $utc = false])
  • string $name
  • integer|array $value
  • boolean $utc
attachLdap (line 159)

Attach node to an LDAP connection

This is an offline method.

Zend_Ldap_Node attachLdap (Zend_Ldap $ldap)
countChildren (line 965)

Count children of current node.

This is an online method.

  • throws: Zend_Ldap_Exception
  • access: public
integer countChildren ()
countSubtree (line 952)

Count items in current subtree found by given filter.

This is an online method.

  • throws: Zend_Ldap_Exception
  • access: public
integer countSubtree (string|Zend_Ldap_Filter_Abstract $filter, [integer $scope = Zend_Ldap::SEARCH_SCOPE_SUB])
current (line 1056)

Return the current attribute.

Implements Iterator

  • access: public
array current ()

Implementation of:
Iterator::current
RecursiveIterator::current
delete (line 386)

Marks this node as to be deleted

Node will be deleted on calling update() if $delete is true.

  • return: Provides a fluid interface
  • access: public
Zend_Ldap_Node delete ()
deleteAttribute (line 757)

Deletes a LDAP attribute.

This method deletes the attribute.

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node deleteAttribute (string $name)
  • string $name
detachLdap (line 188)

Detach node from LDAP connection

This is an offline method.

  • return: Provides a fluid interface
  • access: public
Zend_Ldap_Node detachLdap ()
exists (line 893)

Check if node exists on LDAP.

This is an online method.

  • throws: Zend_Ldap_Exception
  • access: public
boolean exists ([Zend_Ldap $ldap = null])
getChangedData (line 592)

Gets changed node data.

The array contains all changed attributes. This format can be used in Zend_Ldap::add() and Zend_Ldap::update().

This is an offline method.

  • access: public
array getChangedData ()
getChanges (line 612)

Returns all changes made.

This is an offline method.

  • access: public
array getChanges ()
getChildren (line 1015)

Returns the children for the current node.

Can be used offline but returns an empty array if children have not been retrieved yet.

  • throws: Zend_Ldap_Exception
  • access: public

Implementation of:
RecursiveIterator::getChildren
getCurrentDn (line 482)

Gets the current DN of the current node as a Zend_Ldap_Dn.

The method returns a clone of the node's DN to prohibit modification.

This is an offline method.

  • access: public
Zend_Ldap_Dn getCurrentDn ()
getLdap (line 137)

Gets the current LDAP connection.

  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap getLdap ()
getParent (line 1040)

Returns the parent of the current node.

  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node getParent ([Zend_Ldap $ldap = null])
hasChildren (line 994)

Checks if current node has children.

Returns whether the current element has children.

Can be used offline but returns false if children have not been retrieved yet.

  • throws: Zend_Ldap_Exception
  • access: public
boolean hasChildren ()

Implementation of:
RecursiveIterator::hasChildren
isAttached (line 206)

Checks if the current node is attached to a LDAP server.

This is an offline method.

  • access: public
boolean isAttached ()
isNew (line 351)

Tells if the node is consiedered as new (not present on the server)

Please note, that this doesn't tell you if the node is present on the server. Use exits() to see if a node is already there.

  • access: public
boolean isNew ()
key (line 1067)

Return the attribute name.

Implements Iterator

  • access: public
string key ()

Implementation of:
Iterator::key
RecursiveIterator::key
move (line 517)

{@see setDn()}

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node move (Zend_Ldap_Dn|string|array $newDn)
next (line 1076)

Move forward to next attribute.

Implements Iterator

  • access: public
void next ()

Implementation of:
Iterator::next
RecursiveIterator::next
offsetSet (line 862)

Sets a LDAP attribute.

Implements ArrayAccess.

This is an offline method.

  • throws: Zend_Ldap_Exception
  • access: public
null offsetSet (string $name, mixed $value)
  • string $name
  • mixed $value

Redefinition of:
Zend_Ldap_Node_Abstract::offsetSet()
Sets a LDAP attribute.
offsetUnset (line 879)

Deletes a LDAP attribute.

Implements ArrayAccess.

This method deletes the attribute.

This is an offline method.

  • throws: Zend_Ldap_Exception
  • access: public
null offsetUnset (string $name)
  • string $name

Redefinition of:
Zend_Ldap_Node_Abstract::offsetUnset()
Deletes a LDAP attribute.
reload (line 911)

Reload node attributes from LDAP.

This is an online method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node reload ([Zend_Ldap $ldap = null])

Redefinition of:
Zend_Ldap_Node_Abstract::reload()
Reload node attributes from LDAP.
removeDuplicatesFromAttribute (line 771)

Removes duplicate values from a LDAP attribute

  • access: public
void removeDuplicatesFromAttribute (string $attribName)
  • string $attribName
removeFromAttribute (line 783)

Remove given values from a LDAP attribute

  • access: public
void removeFromAttribute (string $attribName, mixed|array $value)
  • string $attribName
  • mixed|array $value
rename (line 531)

{@see setDn()}

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node rename (Zend_Ldap_Dn|string|array $newDn)
rewind (line 1085)

Rewind the Iterator to the first attribute.

Implements Iterator

  • access: public
void rewind ()

Implementation of:
Iterator::rewind
RecursiveIterator::rewind
searchChildren (line 980)

Gets children of current node.

This is an online method.

  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node_Collection searchChildren (string|Zend_Ldap_Filter_Abstract $filter, [string $sort = null])
searchSubtree (line 932)

Search current subtree with given options.

This is an online method.

  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node_Collection searchSubtree (string|Zend_Ldap_Filter_Abstract $filter, [integer $scope = Zend_Ldap::SEARCH_SCOPE_SUB], [string $sort = null])
setAttribute (line 644)

Sets a LDAP attribute.

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node setAttribute (string $name, mixed $value)
  • string $name
  • mixed $value
setDateTimeAttribute (line 691)

Sets a LDAP date/time attribute.

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node setDateTimeAttribute (string $name, integer|array $value, [boolean $utc = false])
  • string $name
  • integer|array $value
  • boolean $utc
setDn (line 497)

Sets the new DN for this node

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node setDn (Zend_Ldap_Dn|string|array $newDn)
setObjectClass (line 545)

Sets the objectClass.

This is an offline method.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node setObjectClass (array|string $value)
  • array|string $value
setPasswordAttribute (line 738)

Sets a LDAP password.

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node setPasswordAttribute (string $password, [string $hashType = Zend_Ldap_Attribute::PASSWORD_HASH_MD5], [string $attribName = 'userPassword'])
  • string $password
  • string $hashType
  • string $attribName
toLdif (line 572)

Returns a LDIF representation of the current node

  • access: public
string toLdif ([ $options = array()])
  • array $options: Additional options used during encoding
update (line 415)

Sends all pending changes to the LDAP server

  • return: Provides a fluid interface
  • throws: Zend_Ldap_Exception
  • access: public
Zend_Ldap_Node update ([Zend_Ldap $ldap = null])
valid (line 1097)

Check if there is a current attribute after calls to rewind() or next().

Implements Iterator

  • access: public
boolean valid ()

Implementation of:
Iterator::valid
RecursiveIterator::valid
willBeDeleted (line 374)

Is this node going to be deleted once update() is called?

  • access: public
boolean willBeDeleted ()
willBeMoved (line 397)

Is this node going to be moved once update() is called?

  • access: public
boolean willBeMoved ()
_assertChangeableAttribute (line 793)
  • throws: Zend_Ldap_Exception
  • access: protected
boolean _assertChangeableAttribute (string $name)
  • string $name
_ensureRdnAttributeValues (line 324)

Ensures that teh RDN attributes are correctly set.

  • access: protected
void _ensureRdnAttributeValues ()
_getDn (line 469)

Gets the DN of the current node as a Zend_Ldap_Dn.

This is an offline method.

  • access: protected
Zend_Ldap_Dn _getDn ()

Redefinition of:
Zend_Ldap_Node_Abstract::_getDn()
Gets the DN of the current node as a Zend_Ldap_Dn.
_loadData (line 216)
  • throws: Zend_Ldap_Exception
  • access: protected
void _loadData ( $data, boolean $fromDataSource)
  • array $data
  • boolean $fromDataSource

Redefinition of:
Zend_Ldap_Node_Abstract::_loadData()
_markAsNew (line 338)

Marks this node as new.

Node will be added (instead of updated) on calling update() if $new is true.

  • access: protected
void _markAsNew (boolean $new)
  • boolean $new
_markAsToBeDeleted (line 363)

Marks this node as to be deleted.

Node will be deleted on calling update() if $delete is true.

  • access: protected
void _markAsToBeDeleted (boolean $delete)
  • boolean $delete
_setAttribute (line 674)

Checks if the attribute can be set and sets it accordingly.

  • throws: Zend_Ldap_Exception
  • access: protected
void _setAttribute (string $name, mixed $value, boolean $append)
  • string $name
  • mixed $value
  • boolean $append
_setDateTimeAttribute (line 723)

Checks if the attribute can be set and sets it accordingly.

  • throws: Zend_Ldap_Exception
  • access: protected
void _setDateTimeAttribute (string $name, integer|array $value, boolean $utc, boolean $append)
  • string $name
  • integer|array $value
  • boolean $utc
  • boolean $append
__set (line 830)

Sets a LDAP attribute.

This is an offline method.

  • throws: Zend_Ldap_Exception
  • access: public
null __set (string $name, mixed $value)
  • string $name
  • mixed $value

Redefinition of:
Zend_Ldap_Node_Abstract::__set()
Sets a LDAP attribute.
__sleep (line 113)

Serialization callback

Only DN and attributes will be serialized.

  • access: public
array __sleep ()
__unset (line 846)

Deletes a LDAP attribute.

This method deletes the attribute.

This is an offline method.

  • throws: Zend_Ldap_Exception
  • access: public
null __unset (string $name)
  • string $name

Redefinition of:
Zend_Ldap_Node_Abstract::__unset()
Deletes a LDAP attribute.
__wakeup (line 126)

Deserialization callback

Enforces a detached node.

  • access: public
null __wakeup ()

Inherited Methods

Inherited From Zend_Ldap_Node_Abstract

 Zend_Ldap_Node_Abstract::__construct()
 Zend_Ldap_Node_Abstract::attributeHasValue()
 Zend_Ldap_Node_Abstract::count()
 Zend_Ldap_Node_Abstract::existsAttribute()
 Zend_Ldap_Node_Abstract::getAttribute()
 Zend_Ldap_Node_Abstract::getAttributes()
 Zend_Ldap_Node_Abstract::getData()
 Zend_Ldap_Node_Abstract::getDateTimeAttribute()
 Zend_Ldap_Node_Abstract::getDn()
 Zend_Ldap_Node_Abstract::getDnArray()
 Zend_Ldap_Node_Abstract::getDnString()
 Zend_Ldap_Node_Abstract::getObjectClass()
 Zend_Ldap_Node_Abstract::getRdnArray()
 Zend_Ldap_Node_Abstract::getRdnString()
 Zend_Ldap_Node_Abstract::offsetExists()
 Zend_Ldap_Node_Abstract::offsetGet()
 Zend_Ldap_Node_Abstract::offsetSet()
 Zend_Ldap_Node_Abstract::offsetUnset()
 Zend_Ldap_Node_Abstract::reload()
 Zend_Ldap_Node_Abstract::toArray()
 Zend_Ldap_Node_Abstract::toJson()
 Zend_Ldap_Node_Abstract::toString()
 Zend_Ldap_Node_Abstract::_getDn()
 Zend_Ldap_Node_Abstract::_loadData()
 Zend_Ldap_Node_Abstract::__get()
 Zend_Ldap_Node_Abstract::__isset()
 Zend_Ldap_Node_Abstract::__set()
 Zend_Ldap_Node_Abstract::__toString()
 Zend_Ldap_Node_Abstract::__unset()

Documentation generated on Mon, 21 Jun 2010 15:35:38 -0400 by phpDocumentor 1.4.3