Zend\Ldap\Node provides an object oriented view into a LDAP node.

package Default
inherited_from \Zend\Ldap\Node\AbstractNode

 Methods

Gets a LDAP attribute.

__get(string $name) : mixed
Inherited

This is an offline method.

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

mixed

Checks whether a given attribute exists.

__isset(string $name) : boolean
Inherited

Empty attributes will be treated as non-existent.

Parameters

$name

string

Returns

boolean

Sets a LDAP attribute.

__set(string $name, mixed $value) 

This is an offline method.

inherited_from \Zend\Ldap\Node\AbstractNode::__set()

Parameters

$name

string

$value

Sets a LDAP attribute.

__set(string $name, mixed $value) 
Inherited

This is an offline method.

Parameters

$name

string

$value

mixed

Exceptions

\Zend\Ldap\Exception\BadMethodCallException

Serialization callback

__sleep() : array

Only Dn and attributes will be serialized.

Returns

array

Cast to string representation {@see toString()}

__toString() : string
Inherited

Returns

string

Deletes a LDAP attribute.

__unset(string $name) 

This method deletes the attribute.

This is an offline method.

inherited_from \Zend\Ldap\Node\AbstractNode::__unset()

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

Deletes a LDAP attribute.

__unset($name) 
Inherited

This method deletes the attribute.

This is an offline method.

Parameters

$name

Exceptions

\Zend\Ldap\Exception\BadMethodCallException

Deserialization callback

__wakeup() 

Enforces a detached node.

Appends to the objectClass.

appendObjectClass(array|string $value) : \Zend\Ldap\Node

This is an offline method.

Parameters

$value

arraystring

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Appends to a LDAP attribute.

appendToAttribute(string $name, mixed $value) : \Zend\Ldap\Node

This is an offline method.

Parameters

$name

string

$value

mixed

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Appends to a LDAP date/time attribute.

appendToDateTimeAttribute(string $name, integer|array $value, boolean $utc = false) : \Zend\Ldap\Node

This is an offline method.

Parameters

$name

string

$value

integerarray

$utc

boolean

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Attach node to an LDAP connection

attachLdap(\Zend\Ldap\Ldap $ldap) : \Zend\Ldap\Node

This is an offline method.

Parameters

$ldap

\Zend\Ldap\Ldap

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Checks if the given value(s) exist in the attribute

attributeHasValue(string $attribName, mixed|array $value) : boolean
Inherited

Parameters

$attribName

string

$value

mixedarray

Returns

boolean

Returns the number of attributes in node.

count() : integer
Inherited

Implements Countable

Returns

integer

Count children of current node.

countChildren() : integer

This is an online method.

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

integer

Count items in current subtree found by given filter.

countSubtree(string|\Zend\Ldap\Filter\AbstractFilter $filter, integer $scope = \Zend\Ldap\Ldap::SEARCH_SCOPE_SUB) : integer

This is an online method.

Parameters

$filter

string\Zend\Ldap\Filter\AbstractFilter

$scope

integer

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

integer

Factory method to create a new detached Zend\Ldap\Node for a given DN.

create(string|array|\Zend\Ldap\Dn $dn, array $objectClass = array()) : \Zend\Ldap\Node
Static

Parameters

$dn

stringarray\Zend\Ldap\Dn

$objectClass

array

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\Node

Return the current attribute.

current() : array

Implements Iterator

Returns

array

Marks this node as to be deleted

delete() : \Zend\Ldap\Node

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

Returns

\Zend\Ldap\NodeProvides a fluid interface

Deletes a LDAP attribute.

deleteAttribute(string $name) : \Zend\Ldap\Node

This method deletes the attribute.

This is an offline method.

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Detach node from LDAP connection

detachLdap() : \Zend\Ldap\Node

This is an offline method.

Returns

\Zend\Ldap\NodeProvides a fluid interface

Check if node exists on LDAP.

exists(\Zend\Ldap\Ldap $ldap = null) : boolean

This is an online method.

Parameters

$ldap

\Zend\Ldap\Ldap

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

boolean

Checks whether a given attribute exists.

existsAttribute(string $name, boolean $emptyExists = false) : boolean
Inherited

If $emptyExists is false empty attributes (containing only array()) are treated as non-existent returning false. If $emptyExists is true empty attributes are treated as existent returning true. In this case method returns false only if the attribute name is missing in the key-collection.

Parameters

$name

string

$emptyExists

boolean

Returns

boolean

Factory method to create a detached Zend\Ldap\Node from array data.

fromArray(array $data, boolean $fromDataSource = false) : \Zend\Ldap\Node
Static

Parameters

$data

array

$fromDataSource

boolean

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\Node

Factory method to create an attached Zend\Ldap\Node for a given DN.

fromLdap(string|array|\Zend\Ldap\Dn $dn, \Zend\Ldap\Ldap $ldap) : \Zend\Ldap\Node | null
Static

Parameters

$dn

stringarray\Zend\Ldap\Dn

$ldap

\Zend\Ldap\Ldap

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\Nodenull

Gets a LDAP attribute.

getAttribute(string $name, integer $index = null) : mixed
Inherited

This is an offline method.

Parameters

$name

string

$index

integer

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

mixed

Gets all attributes of node.

getAttributes(boolean $includeSystemAttributes = true) : array
Inherited

The collection contains all attributes.

This is an offline method.

Parameters

$includeSystemAttributes

boolean

Returns

array

Gets changed node data.

getChangedData() : array

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

This is an offline method.

Returns

array

Returns all changes made.

getChanges() : array

This is an offline method.

Returns

array

Returns the children for the current node.

getChildren() : \Zend\Ldap\Node\ChildrenIterator

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

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\Node\ChildrenIterator

Gets the current DN of the current node as a Zend\Ldap\Dn.

getCurrentDn() : \Zend\Ldap\Dn

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

This is an offline method.

Returns

\Zend\Ldap\Dn

Gets node attributes.

getData(boolean $includeSystemAttributes = true) : array
Inherited

The array contains all attributes in its internal format (no conversion).

This is an offline method.

Parameters

$includeSystemAttributes

boolean

Returns

array

Gets a LDAP date/time attribute.

getDateTimeAttribute(string $name, integer $index = null) : array | integer
Inherited

This is an offline method.

Parameters

$name

string

$index

integer

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

arrayinteger

Gets the DN of the current node as a Zend\Ldap\Dn.

getDn() : \Zend\Ldap\Dn
Inherited

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

This is an offline method.

Returns

\Zend\Ldap\Dn

Gets the DN of the current node as an array.

getDnArray(string $caseFold = null) : array
Inherited

This is an offline method.

Parameters

$caseFold

string

Returns

array

Gets the DN of the current node as a string.

getDnString(string $caseFold = null) : string
Inherited

This is an offline method.

Parameters

$caseFold

string

Returns

string

Gets the current LDAP connection.

getLdap() : \Zend\Ldap\Ldap

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\Ldap

Gets the objectClass of the node

getObjectClass() : array
Inherited

Returns

array

Returns the parent of the current node.

getParent(\Zend\Ldap\Ldap $ldap = null) : \Zend\Ldap\Node

Parameters

$ldap

\Zend\Ldap\Ldap

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\Node

Gets the RDN of the current node as an array.

getRdnArray(string $caseFold = null) : array
Inherited

This is an offline method.

Parameters

$caseFold

string

Returns

array

Gets the RDN of the current node as a string.

getRdnString(string $caseFold = null) : string
Inherited

This is an offline method.

Parameters

$caseFold

string

Returns

string

Checks if current node has children.

hasChildren() : boolean

Returns whether the current element has children.

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

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

boolean

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

isAttached() : boolean

This is an offline method.

Returns

boolean

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

isNew() : boolean

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

Returns

boolean

Return the attribute name.

key() : string

Implements Iterator

Returns

string

{@see setDn()}

move(\Zend\Ldap\Dn|string|array $newDn) : \Zend\Ldap\Node

This is an offline method.

Parameters

$newDn

\Zend\Ldap\Dnstringarray

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Move forward to next attribute.

next() 

Implements Iterator

Checks whether a given attribute exists.

offsetExists(string $name) : boolean
Inherited

Implements ArrayAccess.

Empty attributes will be treated as non-existent.

Parameters

$name

string

Returns

boolean

Gets a LDAP attribute.

offsetGet(string $name) : mixed
Inherited

Implements ArrayAccess.

This is an offline method.

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

mixed

Sets a LDAP attribute.

offsetSet(string $name, mixed $value) 

Implements ArrayAccess.

This is an offline method.

inherited_from \Zend\Ldap\Node\AbstractNode::offsetSet()

Parameters

$name

string

$value

mixed

Exceptions

\Zend\Ldap\Exception\LdapException

Sets a LDAP attribute.

offsetSet(string $name, mixed $value) 
Inherited

Implements ArrayAccess.

This is an offline method.

Parameters

$name

string

$value

mixed

Exceptions

\Zend\Ldap\Exception\BadMethodCallException
\Zend\Ldap\Exception\BadMethodCallException

Deletes a LDAP attribute.

offsetUnset(string $name) 

Implements ArrayAccess.

This method deletes the attribute.

This is an offline method.

inherited_from \Zend\Ldap\Node\AbstractNode::offsetUnset()

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

Deletes a LDAP attribute.

offsetUnset($name) 
Inherited

Implements ArrayAccess.

This method deletes the attribute.

This is an offline method.

Parameters

$name

Exceptions

\Zend\Ldap\Exception\BadMethodCallException

Reload node attributes from LDAP.

reload(\Zend\Ldap\Ldap $ldap = null) : \Zend\Ldap\Node

This is an online method.

inherited_from \Zend\Ldap\Node\AbstractNode::reload()

Parameters

$ldap

\Zend\Ldap\Ldap

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Reload node attributes from LDAP.

reload(\Zend\Ldap\Ldap $ldap = null) : \Zend\Ldap\Node\AbstractNode
Inherited

This is an online method.

Parameters

$ldap

\Zend\Ldap\Ldap

Returns

\Zend\Ldap\Node\AbstractNodeProvides a fluid interface

Removes duplicate values from a LDAP attribute

removeDuplicatesFromAttribute(string $attribName) : void

Parameters

$attribName

string

Remove given values from a LDAP attribute

removeFromAttribute(string $attribName, mixed|array $value) : void

Parameters

$attribName

string

$value

mixedarray

{@see setDn()}

rename(\Zend\Ldap\Dn|string|array $newDn) : \Zend\Ldap\Node

This is an offline method.

Parameters

$newDn

\Zend\Ldap\Dnstringarray

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Rewind the Iterator to the first attribute.

rewind() 

Implements Iterator

Gets children of current node.

searchChildren(string|\Zend\Ldap\Filter\AbstractFilter $filter, string $sort = null) : \Zend\Ldap\Node\Collection

This is an online method.

Parameters

$filter

string\Zend\Ldap\Filter\AbstractFilter

$sort

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\Node\Collection

Search current subtree with given options.

searchSubtree(string|\Zend\Ldap\Filter\AbstractFilter $filter, integer $scope = \Zend\Ldap\Ldap::SEARCH_SCOPE_SUB, string $sort = null) : \Zend\Ldap\Node\Collection

This is an online method.

Parameters

$filter

string\Zend\Ldap\Filter\AbstractFilter

$scope

integer

$sort

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\Node\Collection

Sets a LDAP attribute.

setAttribute(string $name, mixed $value) : \Zend\Ldap\Node

This is an offline method.

Parameters

$name

string

$value

mixed

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Sets a LDAP date/time attribute.

setDateTimeAttribute(string $name, integer|array $value, boolean $utc = false) : \Zend\Ldap\Node

This is an offline method.

Parameters

$name

string

$value

integerarray

$utc

boolean

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Sets the new DN for this node

setDn(\Zend\Ldap\Dn|string|array $newDn) : \Zend\Ldap\Node

This is an offline method.

Parameters

$newDn

\Zend\Ldap\Dnstringarray

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Sets the objectClass.

setObjectClass(array|string $value) : \Zend\Ldap\Node

This is an offline method.

Parameters

$value

arraystring

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Sets a LDAP password.

setPasswordAttribute(string $password, string $hashType = \Zend\Ldap\Attribute::PASSWORD_HASH_MD5, string $attribName = 'userPassword') : \Zend\Ldap\Node

Parameters

$password

string

$hashType

string

$attribName

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

Returns an array representation of the current node

toArray(boolean $includeSystemAttributes = true) : array
Inherited

Parameters

$includeSystemAttributes

boolean

Returns

array

Returns a JSON representation of the current node

toJson(boolean $includeSystemAttributes = true) : string
Inherited

Parameters

$includeSystemAttributes

boolean

Returns

string

Returns a LDIF representation of the current node

toLdif(array $options = array()) : string

Parameters

$options

array

Additional options used during encoding

Returns

string

Returns the DN of the current node. {@see getDnString()}

toString() : string
Inherited

Returns

string

Sends all pending changes to the LDAP server

update(\Zend\Ldap\Ldap $ldap = null) : \Zend\Ldap\Node
trigger pre-delete
trigger post-delete
trigger pre-add
trigger post-add
trigger pre-rename
trigger post-rename
trigger pre-update
trigger post-update

Parameters

$ldap

\Zend\Ldap\Ldap

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides a fluid interface

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

valid() : boolean

Implements Iterator

Returns

boolean

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

willBeDeleted() : boolean

Returns

boolean

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

willBeMoved() : boolean

Returns

boolean

Constructor.

__construct(\Zend\Ldap\Dn $dn, array $data, boolean $fromDataSource, \Zend\Ldap\Ldap $ldap = null

Constructor is protected to enforce the use of factory methods.

inherited_from \Zend\Ldap\Node\AbstractNode::__construct()

Parameters

$dn

\Zend\Ldap\Dn

$data

array

$fromDataSource

boolean

$ldap

\Zend\Ldap\Ldap

Exceptions

\Zend\Ldap\Exception\LdapException

Constructor.

__construct(\Zend\Ldap\Dn $dn, array $data, boolean $fromDataSource) 
Inherited

Constructor is protected to enforce the use of factory methods.

Parameters

$dn

\Zend\Ldap\Dn

$data

array

$fromDataSource

boolean

Gets the DN of the current node as a Zend\Ldap\Dn.

_getDn() : \Zend\Ldap\Dn

This is an offline method.

inherited_from \Zend\Ldap\Node\AbstractNode::_getDn()

Returns

\Zend\Ldap\Dn

Gets the DN of the current node as a Zend\Ldap\Dn.

_getDn() : \Zend\Ldap\Dn
Inherited

This is an offline method.

Returns

\Zend\Ldap\Dn

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

_setAttribute(string $name, mixed $value, boolean $append) 

Parameters

$name

string

$value

mixed

$append

boolean

Exceptions

\Zend\Ldap\Exception\LdapException

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

_setDateTimeAttribute(string $name, integer|array $value, boolean $utc, boolean $append) 

Parameters

$name

string

$value

integerarray

$utc

boolean

$append

boolean

Exceptions

\Zend\Ldap\Exception\LdapException

assertChangeableAttribute()

assertChangeableAttribute(string $name) : boolean

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

boolean

Ensures that teh RDN attributes are correctly set.

ensureRdnAttributeValues(boolean $overwrite = false) : void

Parameters

$overwrite

boolean

True to overwrite the RDN attributes

loadData()

loadData(array $data, boolean $fromDataSource) 
inherited_from \Zend\Ldap\Node\AbstractNode::loadData()

Parameters

$data

array

$fromDataSource

boolean

Exceptions

\Zend\Ldap\Exception\LdapException

loadData()

loadData(array $data, boolean $fromDataSource) 
Inherited

Parameters

$data

array

$fromDataSource

boolean

Marks this node as new.

markAsNew(boolean $new) 

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

Parameters

$new

boolean

Marks this node as to be deleted.

markAsToBeDeleted(boolean $delete) 

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

Parameters

$delete

boolean

Trigger an event

triggerEvent(string $event, array|\ArrayAccess $argv = array()

Parameters

$event

string

Event name

$argv

array\ArrayAccess

Array of arguments; typically, should be associative

 Properties

 

Holds an array of the current node's children.

$children : array<mixed,\Zend\Ldap\Node>

Default

 

Holds the node's current data.

$currentData : array

Default

 

This node will be deleted

$delete : boolean

Default

 

Holds the node's DN.

$dn : \Zend\Ldap\Dn

Default

 

$events

$events : \Zend\EventManager\EventManager

Default

 

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

$ldap : \Zend\Ldap\Ldap

Default

 

This node will be added

$new : boolean

Default

 

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

$newDn : \Zend\Ldap\Dn

Default

 

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

$originalData : array

Default

 

$systemAttributes

$systemAttributes 

Default

array('createtimestamp', 'creatorsname', 'entrycsn', 'entrydn', 'entryuuid', 'hassubordinates', 'modifiersname', 'modifytimestamp', 'structuralobjectclass', 'subschemasubentry', 'distinguishedname', 'instancetype', 'name', 'objectcategory', 'objectguid', 'usnchanged', 'usncreated', 'whenchanged', 'whencreated')
Static
 

Controls iteration status

$iteratorRewind : boolean

Default

false