Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Zend_Ldap_Node provides an object oriented view into a LDAP node.
array $_children = ''
Holds an array of the current node's children.
boolean $_delete = ''
This node will be deleted
boolean $_iteratorRewind = 'false'
Controls iteration status
Zend_Ldap $_ldap = ''
Holds the connection to the LDAP server if in connected mode.
boolean $_new = ''
This node will be added
Zend_Ldap_Dn $_newDn = ''
Holds the node's new DN if node is renamed.
array $_originalData = ''
Holds the node's orginal attributes (as loaded).
__construct(
Zend_Ldap_Dn $dn, array $data, boolean $fromDataSource, Zend_Ldap $ldap
=
null
)
:
Constructor.
Constructor is protected to enforce the use of factory methods.
__set(
string $name, mixed $value
)
:
null
Sets a LDAP attribute.
This is an offline method.
__sleep(
)
:
array
Serialization callback
Only DN and attributes will be serialized.
__unset(
string $name
)
:
null
Deletes a LDAP attribute.
This method deletes the attribute.
This is an offline method.
__wakeup(
)
:
null
Deserialization callback
Enforces a detached node.
_assertChangeableAttribute(
string $name
)
:
boolean
_ensureRdnAttributeValues(
)
:
void
Ensures that teh RDN attributes are correctly set.
_getDn(
)
:
Zend_Ldap_Dn
Gets the DN of the current node as a Zend_Ldap_Dn.
This is an offline method.
_loadData(
array $data, boolean $fromDataSource
)
:
_markAsNew(
boolean $new
)
:
Marks this node as new.
Node will be added (instead of updated) on calling update() if $new is true.
_markAsToBeDeleted(
boolean $delete
)
:
Marks this node as to be deleted.
Node will be deleted on calling update() if $delete is true.
_setAttribute(
string $name, mixed $value, boolean $append
)
:
Checks if the attribute can be set and sets it accordingly.
_setDateTimeAttribute(
string $name, integer|array $value, boolean $utc, boolean $append
)
:
Checks if the attribute can be set and sets it accordingly.
appendObjectClass(
array|string $value
)
:
Zend_Ldap_Node
Appends to the objectClass.
This is an offline method.
appendToAttribute(
string $name, mixed $value
)
:
Zend_Ldap_Node
Appends to a LDAP attribute.
This is an offline method.
appendToDateTimeAttribute(
string $name, integer|array $value, boolean $utc
=
false
)
:
Zend_Ldap_Node
Appends to a LDAP date/time attribute.
This is an offline method.
attachLdap(
Zend_Ldap $ldap
)
:
Zend_Ldap_Node
Attach node to an LDAP connection
This is an offline method.
countChildren(
)
:
integer
Count children of current node.
This is an online method.
countSubtree(
string|Zend_Ldap_Filter_Abstract $filter, integer $scope
=
Zend_Ldap
)
:
integer
Count items in current subtree found by given filter.
This is an online method.
create(
string|array|Zend_Ldap_Dn $dn, array $objectClass
=
array
)
:
Zend_Ldap_Node
Factory method to create a new detached Zend_Ldap_Node for a given DN.
current(
)
:
array
Return the current attribute.
Implements Iterator
delete(
)
:
Zend_Ldap_Node
Marks this node as to be deleted
Node will be deleted on calling update() if $delete is true.
deleteAttribute(
string $name
)
:
Zend_Ldap_Node
Deletes a LDAP attribute.
This method deletes the attribute.
This is an offline method.
detachLdap(
)
:
Zend_Ldap_Node
Detach node from LDAP connection
This is an offline method.
exists(
Zend_Ldap $ldap
=
null
)
:
boolean
Check if node exists on LDAP.
This is an online method.
fromArray(
array $data, boolean $fromDataSource
=
false
)
:
Zend_Ldap_Node
Factory method to create a detached Zend_Ldap_Node from array data.
fromLdap(
string|array|Zend_Ldap_Dn $dn, Zend_Ldap $ldap
)
:
Zend_Ldap_Node|null
Factory method to create an attached Zend_Ldap_Node for a given DN.
getChangedData(
)
:
array
Gets changed node data.
The array contains all changed attributes. This format can be used in {@link Zend_Ldap::add()} and {@link Zend_Ldap::update()}.
This is an offline method.
getChanges(
)
:
array
Returns all changes made.
This is an offline method.
getChildren(
)
:
Zend_Ldap_Node_ChildrenIterator
Returns the children for the current node.
Can be used offline but returns an empty array if children have not been retrieved yet.
getCurrentDn(
)
:
Zend_Ldap_Dn
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.
getLdap(
)
:
Zend_Ldap
Gets the current LDAP connection.
getParent(
Zend_Ldap $ldap
=
null
)
:
Zend_Ldap_Node
Returns the parent of the current node.
hasChildren(
)
:
boolean
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.
isAttached(
)
:
boolean
Checks if the current node is attached to a LDAP server.
This is an offline method.
isNew(
)
:
boolean
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 {@link exits()} to see if a node is already there.
key(
)
:
string
Return the attribute name.
Implements Iterator
move(
Zend_Ldap_Dn|string|array $newDn
)
:
Zend_Ldap_Node
{@see setDn()}
This is an offline method.
next(
)
:
Move forward to next attribute.
Implements Iterator
offsetSet(
string $name, mixed $value
)
:
null
Sets a LDAP attribute.
Implements ArrayAccess.
This is an offline method.
offsetUnset(
string $name
)
:
null
Deletes a LDAP attribute.
Implements ArrayAccess.
This method deletes the attribute.
This is an offline method.
reload(
Zend_Ldap $ldap
=
null
)
:
Zend_Ldap_Node
Reload node attributes from LDAP.
This is an online method.
removeDuplicatesFromAttribute(
string $attribName
)
:
void
Removes duplicate values from a LDAP attribute
removeFromAttribute(
string $attribName, mixed|array $value
)
:
void
Remove given values from a LDAP attribute
rename(
Zend_Ldap_Dn|string|array $newDn
)
:
Zend_Ldap_Node
{@see setDn()}
This is an offline method.
rewind(
)
:
Rewind the Iterator to the first attribute.
Implements Iterator
searchChildren(
string|Zend_Ldap_Filter_Abstract $filter, string $sort
=
null
)
:
Zend_Ldap_Node_Collection
Gets children of current node.
This is an online method.
searchSubtree(
string|Zend_Ldap_Filter_Abstract $filter, integer $scope
=
Zend_Ldap, string $sort
=
null
)
:
Zend_Ldap_Node_Collection
Search current subtree with given options.
This is an online method.
setAttribute(
string $name, mixed $value
)
:
Zend_Ldap_Node
Sets a LDAP attribute.
This is an offline method.
setDateTimeAttribute(
string $name, integer|array $value, boolean $utc
=
false
)
:
Zend_Ldap_Node
Sets a LDAP date/time attribute.
This is an offline method.
setDn(
Zend_Ldap_Dn|string|array $newDn
)
:
Zend_Ldap_Node
Sets the new DN for this node
This is an offline method.
setObjectClass(
array|string $value
)
:
Zend_Ldap_Node
Sets the objectClass.
This is an offline method.
setPasswordAttribute(
string $password, string $hashType
=
Zend_Ldap_Attribute, string $attribName
=
userPassword
)
:
Zend_Ldap_Node
Sets a LDAP password.
toLdif(
array $options
=
array
)
:
string
Returns a LDIF representation of the current node
update(
Zend_Ldap $ldap
=
null
)
:
Zend_Ldap_Node
Sends all pending changes to the LDAP server
valid(
)
:
boolean
Check if there is a current attribute after calls to rewind() or next().
Implements Iterator
willBeDeleted(
)
:
boolean
Is this node going to be deleted once update() is called?
willBeMoved(
)
:
boolean
Is this node going to be moved once update() is called?