Zend Framework
2.4
|
Zend provides an object oriented view into a LDAP node. More...
Public Member Functions | |
__sleep () | |
Serialization callback. | |
__wakeup () | |
Deserialization callback. | |
getLdap () | |
Gets the current LDAP connection. | |
attachLdap (Ldap $ldap) | |
Attach node to an LDAP connection. | |
detachLdap () | |
Detach node from LDAP connection. | |
isAttached () | |
Checks if the current node is attached to a LDAP server. | |
isNew () | |
Tells if the node is considered as new (not present on the server) | |
willBeDeleted () | |
Is this node going to be deleted once update() is called? | |
delete () | |
Marks this node as to be deleted. | |
willBeMoved () | |
Is this node going to be moved once update() is called? | |
update (Ldap $ldap=null) | |
Sends all pending changes to the LDAP server. | |
getCurrentDn () | |
Gets the current DN of the current node as a Zend. | |
setDn ($newDn) | |
Sets the new DN for this node. | |
move ($newDn) | |
{ | |
rename ($newDn) | |
{ | |
setObjectClass ($value) | |
Sets the objectClass. | |
appendObjectClass ($value) | |
Appends to the objectClass. | |
toLdif (array $options=array()) | |
Returns a LDIF representation of the current node. | |
getChangedData () | |
Gets changed node data. | |
getChanges () | |
Returns all changes made. | |
setAttribute ($name, $value) | |
Sets a LDAP attribute. | |
appendToAttribute ($name, $value) | |
Appends to a LDAP attribute. | |
setDateTimeAttribute ($name, $value, $utc=false) | |
Sets a LDAP date/time attribute. | |
appendToDateTimeAttribute ($name, $value, $utc=false) | |
Appends to a LDAP date/time attribute. | |
setPasswordAttribute ($password, $hashType=Attribute::PASSWORD_HASH_MD5, $attribName= 'userPassword') | |
Sets a LDAP password. | |
deleteAttribute ($name) | |
Deletes a LDAP attribute. | |
removeDuplicatesFromAttribute ($attribName) | |
Removes duplicate values from a LDAP attribute. | |
removeFromAttribute ($attribName, $value) | |
Remove given values from a LDAP attribute. | |
__set ($name, $value) | |
Sets a LDAP attribute. | |
__unset ($name) | |
Deletes a LDAP attribute. | |
offsetSet ($name, $value) | |
Sets a LDAP attribute. | |
offsetUnset ($name) | |
Deletes a LDAP attribute. | |
exists (Ldap $ldap=null) | |
Check if node exists on LDAP. | |
reload (Ldap $ldap=null) | |
Reload node attributes from LDAP. | |
searchSubtree ($filter, $scope=Ldap::SEARCH_SCOPE_SUB, $sort=null) | |
Search current subtree with given options. | |
countSubtree ($filter, $scope=Ldap::SEARCH_SCOPE_SUB) | |
Count items in current subtree found by given filter. | |
countChildren () | |
Count children of current node. | |
searchChildren ($filter, $sort=null) | |
Gets children of current node. | |
hasChildren () | |
Checks if current node has children. | |
getChildren () | |
Returns the children for the current node. | |
getParent (Ldap $ldap=null) | |
Returns the parent of the current node. | |
current () | |
Return the current attribute. | |
key () | |
Return the attribute name. | |
next () | |
Move forward to next attribute. | |
rewind () | |
Rewind the Iterator to the first attribute. | |
valid () | |
Check if there is a current attribute after calls to rewind() or next(). | |
![]() | |
reload (Ldap\Ldap $ldap=null) | |
Reload node attributes from LDAP. | |
getDn () | |
Gets the DN of the current node as a Zend. | |
getDnString ($caseFold=null) | |
Gets the DN of the current node as a string. | |
getDnArray ($caseFold=null) | |
Gets the DN of the current node as an array. | |
getRdnString ($caseFold=null) | |
Gets the RDN of the current node as a string. | |
getRdnArray ($caseFold=null) | |
Gets the RDN of the current node as an array. | |
getObjectClass () | |
Gets the objectClass of the node. | |
getAttributes ($includeSystemAttributes=true) | |
Gets all attributes of node. | |
toString () | |
Returns the DN of the current node. | |
__toString () | |
Cast to string representation {. | |
toArray ($includeSystemAttributes=true) | |
Returns an array representation of the current node. | |
toJson ($includeSystemAttributes=true) | |
Returns a JSON representation of the current node. | |
getData ($includeSystemAttributes=true) | |
Gets node attributes. | |
existsAttribute ($name, $emptyExists=false) | |
Checks whether a given attribute exists. | |
attributeHasValue ($attribName, $value) | |
Checks if the given value(s) exist in the attribute. | |
getAttribute ($name, $index=null) | |
Gets a LDAP attribute. | |
getDateTimeAttribute ($name, $index=null) | |
Gets a LDAP date/time attribute. | |
__set ($name, $value) | |
Sets a LDAP attribute. | |
__get ($name) | |
Gets a LDAP attribute. | |
__unset ($name) | |
Deletes a LDAP attribute. | |
__isset ($name) | |
Checks whether a given attribute exists. | |
offsetSet ($name, $value) | |
Sets a LDAP attribute. | |
offsetGet ($name) | |
Gets a LDAP attribute. | |
offsetUnset ($name) | |
Deletes a LDAP attribute. | |
offsetExists ($name) | |
Checks whether a given attribute exists. | |
count () | |
Returns the number of attributes in node. | |
Static Public Member Functions | |
static | create ($dn, array $objectClass=array()) |
Factory method to create a new detached Zend for a given DN. | |
static | fromLdap ($dn, Ldap $ldap) |
Factory method to create an attached Zend for a given DN. | |
static | fromArray (array $data, $fromDataSource=false) |
Factory method to create a detached Zend from array data. | |
Protected Member Functions | |
__construct (Dn $dn, array $data, $fromDataSource, Ldap $ldap=null) | |
Constructor. | |
triggerEvent ($event, $argv=array()) | |
Trigger an event. | |
loadData (array $data, $fromDataSource) | |
ensureRdnAttributeValues ($overwrite=false) | |
Ensures that teh RDN attributes are correctly set. | |
markAsNew ($new) | |
Marks this node as new. | |
markAsToBeDeleted ($delete) | |
Marks this node as to be deleted. | |
_getDn () | |
Gets the DN of the current node as a Zend. | |
_setAttribute ($name, $value, $append) | |
Checks if the attribute can be set and sets it accordingly. | |
_setDateTimeAttribute ($name, $value, $utc, $append) | |
Checks if the attribute can be set and sets it accordingly. | |
assertChangeableAttribute ($name) | |
![]() | |
__construct (Ldap\Dn $dn, array $data, $fromDataSource) | |
Constructor. | |
loadData (array $data, $fromDataSource) | |
_getDn () | |
Gets the DN of the current node as a Zend. | |
Protected Attributes | |
$newDn | |
$originalData | |
$new | |
$delete | |
$ldap | |
$children | |
$events | |
![]() | |
$dn | |
$currentData | |
Additional Inherited Members | |
![]() | |
static | $systemAttributes |
Zend provides an object oriented view into a LDAP node.
__set | ( | $name, | |
$value | |||
) |
Sets a LDAP attribute.
This is an offline method.
string | $name | |
$value |
__sleep | ( | ) |
__unset | ( | $name | ) |
Deletes a LDAP attribute.
This method deletes the attribute.
This is an offline method.
string | $name |
Exception\LdapException |
__wakeup | ( | ) |
Deserialization callback.
Enforces a detached node.
|
protected |
|
protected |
Checks if the attribute can be set and sets it accordingly.
string | $name | |
mixed | $value | |
bool | $append |
Exception\LdapException |
|
protected |
Checks if the attribute can be set and sets it accordingly.
string | $name | |
int | array | $value | |
bool | $utc | |
bool | $append |
Exception\LdapException |
appendObjectClass | ( | $value | ) |
Appends to the objectClass.
This is an offline method.
array | string | $value |
Exception\LdapException |
appendToAttribute | ( | $name, | |
$value | |||
) |
Appends to a LDAP attribute.
This is an offline method.
string | $name | |
mixed | $value |
Exception\LdapException |
appendToDateTimeAttribute | ( | $name, | |
$value, | |||
$utc = false |
|||
) |
Appends to a LDAP date/time attribute.
This is an offline method.
string | $name | |
int | array | $value | |
bool | $utc |
Exception\LdapException |
|
protected |
string | $name |
Exception\LdapException |
attachLdap | ( | Ldap | $ldap | ) |
countChildren | ( | ) |
Count children of current node.
This is an online method.
Exception\LdapException |
countSubtree | ( | $filter, | |
$scope = Ldap::SEARCH_SCOPE_SUB |
|||
) |
Count items in current subtree found by given filter.
This is an online method.
string | Filter\AbstractFilter | $filter | |
int | $scope |
Exception\LdapException |
|
static |
current | ( | ) |
Return the current attribute.
Implements Iterator
delete | ( | ) |
deleteAttribute | ( | $name | ) |
Deletes a LDAP attribute.
This method deletes the attribute.
This is an offline method.
string | $name |
Exception\LdapException |
detachLdap | ( | ) |
|
protected |
Ensures that teh RDN attributes are correctly set.
bool | $overwrite | True to overwrite the RDN attributes |
exists | ( | Ldap | $ldap = null | ) |
Check if node exists on LDAP.
This is an online method.
Ldap | $ldap |
Exception\LdapException |
|
static |
|
static |
getChangedData | ( | ) |
Gets changed node data.
The array contains all changed attributes. This format can be used in ::add() and ::update().
This is an offline method.
getChanges | ( | ) |
Returns all changes made.
This is an offline method.
getChildren | ( | ) |
Returns the children for the current node.
Can be used offline but returns an empty array if children have not been retrieved yet.
Exception\LdapException |
getCurrentDn | ( | ) |
getLdap | ( | ) |
getParent | ( | Ldap | $ldap = null | ) |
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.
Exception\LdapException |
isAttached | ( | ) |
Checks if the current node is attached to a LDAP server.
This is an offline method.
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 exists() to see if a node is already there.
key | ( | ) |
Return the attribute name.
Implements Iterator
|
protected |
array | $data | |
bool | $fromDataSource |
Exception\LdapException |
|
protected |
|
protected |
move | ( | $newDn | ) |
next | ( | ) |
Move forward to next attribute.
Implements Iterator
offsetSet | ( | $name, | |
$value | |||
) |
Sets a LDAP attribute.
Implements ArrayAccess.
This is an offline method.
string | $name | |
mixed | $value |
Exception\LdapException |
offsetUnset | ( | $name | ) |
Deletes a LDAP attribute.
Implements ArrayAccess.
This method deletes the attribute.
This is an offline method.
string | $name |
Exception\LdapException |
reload | ( | Ldap | $ldap = null | ) |
removeDuplicatesFromAttribute | ( | $attribName | ) |
Removes duplicate values from a LDAP attribute.
string | $attribName |
removeFromAttribute | ( | $attribName, | |
$value | |||
) |
Remove given values from a LDAP attribute.
string | $attribName | |
mixed | array | $value |
rename | ( | $newDn | ) |
rewind | ( | ) |
Rewind the Iterator to the first attribute.
Implements Iterator
searchChildren | ( | $filter, | |
$sort = null |
|||
) |
Gets children of current node.
This is an online method.
string | Filter\AbstractFilter | $filter | |
string | $sort |
Exception\LdapException |
searchSubtree | ( | $filter, | |
$scope = Ldap::SEARCH_SCOPE_SUB , |
|||
$sort = null |
|||
) |
Search current subtree with given options.
This is an online method.
string | Filter\AbstractFilter | $filter | |
int | $scope | |
string | $sort |
Exception\LdapException |
setAttribute | ( | $name, | |
$value | |||
) |
Sets a LDAP attribute.
This is an offline method.
string | $name | |
mixed | $value |
Exception\LdapException |
setDateTimeAttribute | ( | $name, | |
$value, | |||
$utc = false |
|||
) |
Sets a LDAP date/time attribute.
This is an offline method.
string | $name | |
int | array | $value | |
bool | $utc |
Exception\LdapException |
setDn | ( | $newDn | ) |
setObjectClass | ( | $value | ) |
Sets the objectClass.
This is an offline method.
array | string | $value |
Exception\LdapException |
setPasswordAttribute | ( | $password, | |
$hashType = Attribute::PASSWORD_HASH_MD5 , |
|||
$attribName = 'userPassword' |
|||
) |
Sets a LDAP password.
string | $password | |
string | $hashType | |
string | $attribName |
Exception\LdapException |
toLdif | ( | array | $options = array() | ) |
Returns a LDIF representation of the current node.
array | $options | Additional options used during encoding |
|
protected |
Trigger an event.
string | $event | Event name |
array | \ArrayAccess | $argv | Array of arguments; typically, should be associative |
update | ( | Ldap | $ldap = null | ) |
valid | ( | ) |
willBeDeleted | ( | ) |
Is this node going to be deleted once update() is called?
willBeMoved | ( | ) |
Is this node going to be moved once update() is called?
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |