1090. Class

1090.1. Zend\Ldap\Node

ZendLdapNode provides an object oriented view into a LDAP node.

1090.1.1. Methods

1090.1.1.1. __construct

__construct()

Constructor.

Constructor is protected to enforce the use of factory methods.

Parameters:
  • Dn
  • array
  • bool
  • Ldap
Throws ExceptionLdapException:
 

1090.1.1.2. __sleep

__sleep()

Serialization callback

Only Dn and attributes will be serialized.

Return type:array

1090.1.1.3. __wakeup

__wakeup()

Deserialization callback

Enforces a detached node.

1090.1.1.4. getLdap

getLdap()

Gets the current LDAP connection.

Return type:Ldap
Throws :ExceptionLdapException

1090.1.1.5. attachLdap

attachLdap()

Attach node to an LDAP connection

This is an offline method.

Parameters:Ldap
Return type:Node Provides a fluid interface
Throws :ExceptionLdapException

1090.1.1.6. detachLdap

detachLdap()

Detach node from LDAP connection

This is an offline method.

Return type:Node Provides a fluid interface

1090.1.1.7. isAttached

isAttached()

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

This is an offline method.

Return type:bool

1090.1.1.8. triggerEvent

triggerEvent()

Trigger an event

Parameters:
  • string – Event name
  • array|ArrayAccess – Array of arguments; typically, should be associative

1090.1.1.9. loadData

loadData()

@param array $data

Parameters:bool
Throws ExceptionLdapException:
 

1090.1.1.10. create

create()

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

Parameters:
  • string|array|Dn
  • array
Return type:

Node

Throws :

ExceptionLdapException

1090.1.1.11. fromLdap

fromLdap()

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

Parameters:
  • string|array|Dn
  • Ldap
Return type:

Node|null

Throws :

ExceptionLdapException

1090.1.1.12. fromArray

fromArray()

Factory method to create a detached ZendLdapNode from array data.

Parameters:
  • array
  • bool
Return type:

Node

Throws :

ExceptionLdapException

1090.1.1.13. ensureRdnAttributeValues

ensureRdnAttributeValues()

Ensures that teh RDN attributes are correctly set.

Parameters:bool – True to overwrite the RDN attributes
Return type:void

1090.1.1.14. markAsNew

markAsNew()

Marks this node as new.

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

Parameters:bool

1090.1.1.15. isNew

isNew()

Tells if the node is considered 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.

Return type:bool

1090.1.1.16. markAsToBeDeleted

markAsToBeDeleted()

Marks this node as to be deleted.

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

Parameters:bool

1090.1.1.17. willBeDeleted

willBeDeleted()

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

Return type:bool

1090.1.1.18. delete

delete()

Marks this node as to be deleted

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

Return type:Node Provides a fluid interface

1090.1.1.19. willBeMoved

willBeMoved()

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

Return type:bool

1090.1.1.20. update

update()

Sends all pending changes to the LDAP server

Parameters:Ldap
Return type:Node Provides a fluid interface
Throws :ExceptionLdapException @trigger pre-delete

@trigger post-delete @trigger pre-add @trigger post-add @trigger pre-rename @trigger post-rename @trigger pre-update @trigger post-update

1090.1.1.21. _getDn

_getDn()

Gets the DN of the current node as a ZendLdapDn.

This is an offline method.

Return type:Dn

1090.1.1.22. getCurrentDn

getCurrentDn()

Gets the current DN of the current node as a ZendLdapDn. The method returns a clone of the node’s DN to prohibit modification.

This is an offline method.

Return type:Dn

1090.1.1.23. setDn

setDn()

Sets the new DN for this node

This is an offline method.

Parameters:Dn|string|array
Throws ExceptionLdapException:
 
Return type:Node Provides a fluid interface

1090.1.1.24. move

move()

{@see setDn()}

This is an offline method.

Parameters:Dn|string|array
Throws ExceptionLdapException:
 
Return type:Node Provides a fluid interface

1090.1.1.25. rename

rename()

{@see setDn()}

This is an offline method.

Parameters:Dn|string|array
Throws ExceptionLdapException:
 
Return type:Node Provides a fluid interface

1090.1.1.26. setObjectClass

setObjectClass()

Sets the objectClass.

This is an offline method.

Parameters:array|string
Return type:Node Provides a fluid interface
Throws :ExceptionLdapException

1090.1.1.27. appendObjectClass

appendObjectClass()

Appends to the objectClass.

This is an offline method.

Parameters:array|string
Return type:Node Provides a fluid interface
Throws :ExceptionLdapException

1090.1.1.28. toLdif

toLdif()

Returns a LDIF representation of the current node

Parameters:array – Additional options used during encoding
Return type:string

1090.1.1.29. getChangedData

getChangedData()

Gets changed node data.

The array contains all changed attributes. This format can be used in {@link ZendLdapLdap::add()} and {@link ZendLdapLdap::update()}.

This is an offline method.

Return type:array

1090.1.1.30. getChanges

getChanges()

Returns all changes made.

This is an offline method.

Return type:array

1090.1.1.31. setAttribute

setAttribute()

Sets a LDAP attribute.

This is an offline method.

Parameters:
  • string
  • mixed
Return type:

Node Provides a fluid interface

Throws :

ExceptionLdapException

1090.1.1.32. appendToAttribute

appendToAttribute()

Appends to a LDAP attribute.

This is an offline method.

Parameters:
  • string
  • mixed
Return type:

Node Provides a fluid interface

Throws :

ExceptionLdapException

1090.1.1.33. _setAttribute

_setAttribute()

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

Parameters:
  • string
  • mixed
  • bool
Throws ExceptionLdapException:
 

1090.1.1.34. setDateTimeAttribute

setDateTimeAttribute()

Sets a LDAP date/time attribute.

This is an offline method.

Parameters:
  • string
  • integer|array
  • bool
Return type:

Node Provides a fluid interface

Throws :

ExceptionLdapException

1090.1.1.35. appendToDateTimeAttribute

appendToDateTimeAttribute()

Appends to a LDAP date/time attribute.

This is an offline method.

Parameters:
  • string
  • integer|array
  • bool
Return type:

Node Provides a fluid interface

Throws :

ExceptionLdapException

1090.1.1.36. _setDateTimeAttribute

_setDateTimeAttribute()

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

Parameters:
  • string
  • integer|array
  • bool
  • bool
Throws ExceptionLdapException:
 

1090.1.1.37. setPasswordAttribute

setPasswordAttribute()

Sets a LDAP password.

Parameters:
  • string
  • string
  • string
Return type:

Node Provides a fluid interface

Throws :

ExceptionLdapException

1090.1.1.38. deleteAttribute

deleteAttribute()

Deletes a LDAP attribute.

This method deletes the attribute.

This is an offline method.

Parameters:string
Return type:Node Provides a fluid interface
Throws :ExceptionLdapException

1090.1.1.39. removeDuplicatesFromAttribute

removeDuplicatesFromAttribute()

Removes duplicate values from a LDAP attribute

Parameters:string
Return type:void

1090.1.1.40. removeFromAttribute

removeFromAttribute()

Remove given values from a LDAP attribute

Parameters:
  • string
  • mixed|array
Return type:

void

1090.1.1.41. assertChangeableAttribute

assertChangeableAttribute()

@param string $name

Return type:bool
Throws :ExceptionLdapException

1090.1.1.42. __set

__set()

Sets a LDAP attribute.

This is an offline method.

Parameters:
  • string
  • $value

1090.1.1.43. __unset

__unset()

Deletes a LDAP attribute.

This method deletes the attribute.

This is an offline method.

Parameters:string
Throws ExceptionLdapException:
 

1090.1.1.44. offsetSet

offsetSet()

Sets a LDAP attribute. Implements ArrayAccess.

This is an offline method.

Parameters:
  • string
  • mixed
Throws ExceptionLdapException:
 

1090.1.1.45. offsetUnset

offsetUnset()

Deletes a LDAP attribute. Implements ArrayAccess.

This method deletes the attribute.

This is an offline method.

Parameters:string
Throws ExceptionLdapException:
 

1090.1.1.46. exists

exists()

Check if node exists on LDAP.

This is an online method.

Parameters:Ldap
Return type:bool
Throws :ExceptionLdapException

1090.1.1.47. reload

reload()

Reload node attributes from LDAP.

This is an online method.

Parameters:Ldap
Return type:Node Provides a fluid interface
Throws :ExceptionLdapException

1090.1.1.48. searchSubtree

searchSubtree()

Search current subtree with given options.

This is an online method.

Parameters:
  • string|FilterAbstractFilter
  • integer
  • string
Return type:

NodeCollection

Throws :

ExceptionLdapException

1090.1.1.49. countSubtree

countSubtree()

Count items in current subtree found by given filter.

This is an online method.

Parameters:
  • string|FilterAbstractFilter
  • integer
Return type:

integer

Throws :

ExceptionLdapException

1090.1.1.50. countChildren

countChildren()

Count children of current node.

This is an online method.

Return type:integer
Throws :ExceptionLdapException

1090.1.1.51. searchChildren

searchChildren()

Gets children of current node.

This is an online method.

Parameters:
  • string|FilterAbstractFilter
  • string
Return type:

NodeCollection

Throws :

ExceptionLdapException

1090.1.1.52. hasChildren

hasChildren()

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.

Return type:bool
Throws :ExceptionLdapException

1090.1.1.53. getChildren

getChildren()

Returns the children for the current node.

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

Return type:NodeChildrenIterator
Throws :ExceptionLdapException

1090.1.1.54. getParent

getParent()

Returns the parent of the current node.

Parameters:Ldap
Return type:Node
Throws :ExceptionLdapException

1090.1.1.55. current

current()

Return the current attribute. Implements Iterator

Return type:array

1090.1.1.56. key

key()

Return the attribute name. Implements Iterator

Return type:string

1090.1.1.58. rewind

rewind()

Rewind the Iterator to the first attribute. Implements Iterator

1090.1.1.59. valid

valid()

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

Return type:bool

Project Versions

Table Of Contents

Previous topic

1089. Class

Next topic

1091. Class

This Page