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

 Methods

Gets a LDAP attribute.

__get(string $name) : mixed
Inherited

This is an offline method.

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

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

mixed

Checks whether a given attribute exists.

__isset(string $name) : bool
Inherited

Empty attributes will be treated as non-existent.

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

Parameters

$name

string

Returns

bool

Sets a LDAP attribute.

__set(string $name, $value) 

This is an offline method.

Parameters

$name

string

$value

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

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

Returns

string

Deletes a LDAP attribute.

__unset(string $name) 

This method deletes the attribute.

This is an offline method.

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

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, bool $utc) : \Zend\Ldap\Node

This is an offline method.

Parameters

$name

string

$value

integerarray

$utc

bool

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

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) : bool
Inherited

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

Parameters

$attribName

string

$value

mixedarray

Returns

bool

Returns the number of attributes in node.

count() : int
Inherited

Implements Countable

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

Returns

int

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) : integer

This is an online method.

Parameters

$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) : \Zend\Ldap\Node

Parameters

$dn

stringarray\Zend\Ldap\Dn

$objectClass

array

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

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) : bool

This is an online method.

Parameters

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

bool

Checks whether a given attribute exists.

existsAttribute(string $name, bool $emptyExists) : bool
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.

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

Parameters

$name

string

$emptyExists

bool

Returns

bool

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

fromArray(array $data, bool $fromDataSource) : \Zend\Ldap\Node

Parameters

$data

array

$fromDataSource

bool

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

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

Parameters

$dn

stringarray\Zend\Ldap\Dn

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

Gets a LDAP attribute.

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

This is an offline method.

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

Parameters

$name

string

$index

integer

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

mixed

Gets all attributes of node.

getAttributes(bool $includeSystemAttributes) : array
Inherited

The collection contains all attributes.

This is an offline method.

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

Parameters

$includeSystemAttributes

bool

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

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

Gets node attributes.

getData(bool $includeSystemAttributes) : array
Inherited

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

This is an offline method.

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

Parameters

$includeSystemAttributes

bool

Returns

array

Gets a LDAP date/time attribute.

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

This is an offline method.

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

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.

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

Returns

Gets the DN of the current node as an array.

getDnArray(string $caseFold) : array
Inherited

This is an offline method.

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

Parameters

$caseFold

string

Returns

array

Gets the DN of the current node as a string.

getDnString(string $caseFold) : string
Inherited

This is an offline method.

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

Parameters

$caseFold

string

Returns

string

Gets the current LDAP connection.

getLdap() : \Zend\Ldap\Ldap

Gets the objectClass of the node

getObjectClass() : array
Inherited

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

Returns

array

Returns the parent of the current node.

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

Gets the RDN of the current node as an array.

getRdnArray(string $caseFold) : array
Inherited

This is an offline method.

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

Parameters

$caseFold

string

Returns

array

Gets the RDN of the current node as a string.

getRdnString(string $caseFold) : string
Inherited

This is an offline method.

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

Parameters

$caseFold

string

Returns

string

Checks if current node has children.

hasChildren() : bool

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

bool

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

isAttached() : bool

This is an offline method.

Returns

bool

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

isNew() : bool

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.

Returns

bool

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

Checks whether a given attribute exists.

offsetExists(string $name) : bool
Inherited

Implements ArrayAccess.

Empty attributes will be treated as non-existent.

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

Parameters

$name

string

Returns

bool

Gets a LDAP attribute.

offsetGet(string $name) : mixed
Inherited

Implements ArrayAccess.

This is an offline method.

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

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.

Parameters

$name

string

$value

mixed

Exceptions

\Zend\Ldap\Exception\LdapException

Deletes a LDAP attribute.

offsetUnset(string $name) 

Implements ArrayAccess.

This method deletes the attribute.

This is an offline method.

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

Reload node attributes from LDAP.

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

This is an online method.

Parameters

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

\Zend\Ldap\NodeProvides 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) : \Zend\Ldap\Node\Collection

This is an online method.

Parameters

$sort

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

Search current subtree with given options.

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

This is an online method.

Parameters

$scope

integer

$sort

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

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, bool $utc) : \Zend\Ldap\Node

This is an offline method.

Parameters

$name

string

$value

integerarray

$utc

bool

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, string $attribName) : \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(bool $includeSystemAttributes) : array
Inherited

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

Parameters

$includeSystemAttributes

bool

Returns

array

Returns a JSON representation of the current node

toJson(bool $includeSystemAttributes) : string
Inherited

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

Parameters

$includeSystemAttributes

bool

Returns

string

Returns a LDIF representation of the current node

toLdif(array $options) : string

Parameters

$options

array

Additional options used during encoding

Returns

string

Returns the DN of the current node.

toString() : string
Inherited

{@see getDnString()}

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

Returns

string

Sends all pending changes to the LDAP server

update(\Zend\Ldap\Ldap $ldap) : \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

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() : bool

Implements Iterator

Returns

bool

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

willBeDeleted() : bool

Returns

bool

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

willBeMoved() : bool

Returns

bool

Constructor.

__construct(\Zend\Ldap\Dn $dn, array $data, bool $fromDataSource, \Zend\Ldap\Ldap $ldap) 

Constructor is protected to enforce the use of factory methods.

Parameters

$data

array

$fromDataSource

bool

Exceptions

\Zend\Ldap\Exception\LdapException

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

_getDn() : \Zend\Ldap\Dn

This is an offline method.

Returns

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

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

Parameters

$name

string

$value

mixed

$append

bool

Exceptions

\Zend\Ldap\Exception\LdapException

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

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

Parameters

$name

string

$value

integerarray

$utc

bool

$append

bool

Exceptions

\Zend\Ldap\Exception\LdapException

assertChangeableAttribute()

assertChangeableAttribute(string $name) : bool

Parameters

$name

string

Exceptions

\Zend\Ldap\Exception\LdapException

Returns

bool

Ensures that teh RDN attributes are correctly set.

ensureRdnAttributeValues(bool $overwrite) : void

Parameters

$overwrite

bool

True to overwrite the RDN attributes

loadData()

loadData(array $data, bool $fromDataSource) 

Parameters

$data

array

$fromDataSource

bool

Exceptions

\Zend\Ldap\Exception\LdapException

Marks this node as new.

markAsNew(bool $new) 

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

Parameters

$new

bool

Marks this node as to be deleted.

markAsToBeDeleted(bool $delete) 

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

Parameters

$delete

bool

Trigger an event

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

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 : \Zend\Ldap\Node[]

 

Holds the node's current data.

$currentData : array
Inherited

inherited_from \Zend\Ldap\Node\AbstractNode::$$currentData
 

This node will be deleted

$delete : bool

 

Holds the node's DN.

$dn : \Zend\Ldap\Dn
Inherited

inherited_from \Zend\Ldap\Node\AbstractNode::$$dn
 

$events

$events : \Zend\EventManager\EventManager

 

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

$ldap : \Zend\Ldap\Ldap

 

This node will be added

$new : bool

 

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

$newDn : \Zend\Ldap\Dn

 

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

$originalData : array

 

$systemAttributes

$systemAttributes 
Inherited

inherited_from \Zend\Ldap\Node\AbstractNode::$$systemAttributes
 

Controls iteration status

$iteratorRewind : bool