API Documentation

Ldap/Node.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Ldap
subpackage
Node
version
$Id: Node.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Ldap_Node

Description

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

Extends from
Zend_Ldap_Node_Abstract
Implements
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Ldap
subpackage
Node
Properties
$_newDn
$_originalData
$_new
$_delete
$_ldap
$_children
$_iteratorRewind
Methods
__construct
__sleep
__wakeup
getLdap
attachLdap
detachLdap
isAttached
_loadData
create
fromLdap
fromArray
_ensureRdnAttributeValues
_markAsNew
isNew
_markAsToBeDeleted
willBeDeleted
delete
willBeMoved
update
_getDn
getCurrentDn
setDn
move
rename
setObjectClass
appendObjectClass
toLdif
getChangedData
getChanges
setAttribute
appendToAttribute
_setAttribute
setDateTimeAttribute
appendToDateTimeAttribute
_setDateTimeAttribute
setPasswordAttribute
deleteAttribute
removeDuplicatesFromAttribute
removeFromAttribute
_assertChangeableAttribute
__set
__unset
offsetSet
offsetUnset
exists
reload
searchSubtree
countSubtree
countChildren
searchChildren
hasChildren
getChildren
getParent
current
key
next
rewind
valid

Description

Zend_Ldap_Node provides an object oriented view into a LDAP node.

Properties

$_children

array $_children = ''

Holds an array of the current node's children.

Details

$_children
array
visibility
protected
default
final
false
static
false

$_delete

boolean $_delete = ''

This node will be deleted

Details

$_delete
boolean
visibility
protected
default
final
false
static
false

$_iteratorRewind

boolean $_iteratorRewind = 'false'

Controls iteration status

Details

$_iteratorRewind
boolean
visibility
private
default
false
final
false
static
false

$_ldap

Zend_Ldap $_ldap = ''

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

Details

$_ldap
Zend_Ldap
visibility
protected
default
final
false
static
false

$_new

boolean $_new = ''

This node will be added

Details

$_new
boolean
visibility
protected
default
final
false
static
false

$_newDn

Zend_Ldap_Dn $_newDn = ''

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

Details

$_newDn
Zend_Ldap_Dn
visibility
protected
default
final
false
static
false

$_originalData

array $_originalData = ''

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

Details

$_originalData
array
visibility
protected
default
final
false
static
false

Methods

__construct

__construct( Zend_Ldap_Dn $dn, array $data, boolean $fromDataSource, Zend_Ldap $ldap = null ) :

Constructor.

Constructor is protected to enforce the use of factory methods.

Arguments
$dn
Zend_Ldap_Dn
$data
array
$fromDataSource
boolean
$ldap
Zend_Ldap
Details
visibility
protected
final
false
static
false
throws

__set

__set( string $name, mixed $value ) : null

Sets a LDAP attribute.

This is an offline method.

Arguments
$name
string
$value
mixed
Output
null
Details
visibility
public
final
false
static
false
throws

__sleep

__sleep( ) : array

Serialization callback

Only DN and attributes will be serialized.

Output
array
Details
visibility
public
final
false
static
false

__unset

__unset( string $name ) : null

Deletes a LDAP attribute.

This method deletes the attribute.

This is an offline method.

Arguments
$name
string
Output
null
Details
visibility
public
final
false
static
false
throws

__wakeup

__wakeup( ) : null

Deserialization callback

Enforces a detached node.

Output
null
Details
visibility
public
final
false
static
false

_assertChangeableAttribute

_assertChangeableAttribute( string $name ) : boolean

Arguments
$name
string
Output
boolean
Details
visibility
protected
final
false
static
false
throws

_ensureRdnAttributeValues

_ensureRdnAttributeValues( ) : void

Ensures that teh RDN attributes are correctly set.

Details
visibility
protected
final
false
static
false

_getDn

_getDn( ) : Zend_Ldap_Dn

Gets the DN of the current node as a Zend_Ldap_Dn.

This is an offline method.

Output
Zend_Ldap_Dn
Details
visibility
protected
final
false
static
false

_loadData

_loadData( array $data, boolean $fromDataSource ) :

Arguments
$data
array
$fromDataSource
boolean
Details
visibility
protected
final
false
static
false
throws

_markAsNew

_markAsNew( boolean $new ) :

Marks this node as new.

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

Arguments
$new
boolean
Details
visibility
protected
final
false
static
false

_markAsToBeDeleted

_markAsToBeDeleted( boolean $delete ) :

Marks this node as to be deleted.

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

Arguments
$delete
boolean
Details
visibility
protected
final
false
static
false

_setAttribute

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

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

Arguments
$name
string
$value
mixed
$append
boolean
Details
visibility
protected
final
false
static
false
throws

_setDateTimeAttribute

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

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

Arguments
$name
string
$value
integerarray
$utc
boolean
$append
boolean
Details
visibility
protected
final
false
static
false
throws

appendObjectClass

appendObjectClass( array|string $value ) : Zend_Ldap_Node

Appends to the objectClass.

This is an offline method.

Arguments
$value
arraystring
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

appendToAttribute

appendToAttribute( string $name, mixed $value ) : Zend_Ldap_Node

Appends to a LDAP attribute.

This is an offline method.

Arguments
$name
string
$value
mixed
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

appendToDateTimeAttribute

appendToDateTimeAttribute( string $name, integer|array $value, boolean $utc = false ) : Zend_Ldap_Node

Appends to a LDAP date/time attribute.

This is an offline method.

Arguments
$name
string
$value
integerarray
$utc
boolean
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

attachLdap

attachLdap( Zend_Ldap $ldap ) : Zend_Ldap_Node

Attach node to an LDAP connection

This is an offline method.

Arguments
$ldap
Zend_Ldap
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws
uses
Zend_Ldap_Dn::isChildOf()

countChildren

countChildren( ) : integer

Count children of current node.

This is an online method.

Output
integer
Details
visibility
public
final
false
static
false
throws

countSubtree

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.

Arguments
$filter
stringZend_Ldap_Filter_Abstract
$scope
integer
Output
integer
Details
visibility
public
final
false
static
false
throws

create

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.

Arguments
$dn
stringarrayZend_Ldap_Dn
$objectClass
array
Details
visibility
public
final
false
static
true
throws

current

current( ) : array

Return the current attribute.

Implements Iterator

Output
array
Details
visibility
public
final
false
static
false

delete

delete( ) : Zend_Ldap_Node

Marks this node as to be deleted

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

Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false

deleteAttribute

deleteAttribute( string $name ) : Zend_Ldap_Node

Deletes a LDAP attribute.

This method deletes the attribute.

This is an offline method.

Arguments
$name
string
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

detachLdap

detachLdap( ) : Zend_Ldap_Node

Detach node from LDAP connection

This is an offline method.

Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false

exists

exists( Zend_Ldap $ldap = null ) : boolean

Check if node exists on LDAP.

This is an online method.

Arguments
$ldap
Zend_Ldap
Output
boolean
Details
visibility
public
final
false
static
false
throws

fromArray

fromArray( array $data, boolean $fromDataSource = false ) : Zend_Ldap_Node

Factory method to create a detached Zend_Ldap_Node from array data.

Arguments
$data
array
$fromDataSource
boolean
Details
visibility
public
final
false
static
true
throws

fromLdap

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.

Arguments
$dn
stringarrayZend_Ldap_Dn
$ldap
Zend_Ldap
Output
Zend_Ldap_Node|null
Details
visibility
public
final
false
static
true
throws

getChangedData

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.

Output
array
Details
visibility
public
final
false
static
false

getChanges

getChanges( ) : array

Returns all changes made.

This is an offline method.

Output
array
Details
visibility
public
final
false
static
false

getChildren

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.

Details
visibility
public
final
false
static
false
throws

getCurrentDn

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.

Output
Zend_Ldap_Dn
Details
visibility
public
final
false
static
false

getLdap

getLdap( ) : Zend_Ldap

Gets the current LDAP connection.

Output
Zend_Ldap
Details
visibility
public
final
false
static
false
throws

getParent

getParent( Zend_Ldap $ldap = null ) : Zend_Ldap_Node

Returns the parent of the current node.

Arguments
$ldap
Zend_Ldap
Details
visibility
public
final
false
static
false
throws

hasChildren

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.

Output
boolean
Details
visibility
public
final
false
static
false
throws

isAttached

isAttached( ) : boolean

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

This is an offline method.

Output
boolean
Details
visibility
public
final
false
static
false

isNew

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.

Output
boolean
Details
visibility
public
final
false
static
false

key

key( ) : string

Return the attribute name.

Implements Iterator

Output
string
Details
visibility
public
final
false
static
false

move

move( Zend_Ldap_Dn|string|array $newDn ) : Zend_Ldap_Node

{@see setDn()}

This is an offline method.

Arguments
$newDn
Zend_Ldap_Dnstringarray
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

next

next( ) :

Move forward to next attribute.

Implements Iterator

Details
visibility
public
final
false
static
false

offsetSet

offsetSet( string $name, mixed $value ) : null

Sets a LDAP attribute.

Implements ArrayAccess.

This is an offline method.

Arguments
$name
string
$value
mixed
Output
null
Details
visibility
public
final
false
static
false
throws

offsetUnset

offsetUnset( string $name ) : null

Deletes a LDAP attribute.

Implements ArrayAccess.

This method deletes the attribute.

This is an offline method.

Arguments
$name
string
Output
null
Details
visibility
public
final
false
static
false
throws

reload

reload( Zend_Ldap $ldap = null ) : Zend_Ldap_Node

Reload node attributes from LDAP.

This is an online method.

Arguments
$ldap
Zend_Ldap
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

removeDuplicatesFromAttribute

removeDuplicatesFromAttribute( string $attribName ) : void

Removes duplicate values from a LDAP attribute

Arguments
$attribName
string
Details
visibility
public
final
false
static
false

removeFromAttribute

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

Remove given values from a LDAP attribute

Arguments
$attribName
string
$value
mixedarray
Details
visibility
public
final
false
static
false

rename

rename( Zend_Ldap_Dn|string|array $newDn ) : Zend_Ldap_Node

{@see setDn()}

This is an offline method.

Arguments
$newDn
Zend_Ldap_Dnstringarray
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

rewind

rewind( ) :

Rewind the Iterator to the first attribute.

Implements Iterator

Details
visibility
public
final
false
static
false

searchChildren

searchChildren( string|Zend_Ldap_Filter_Abstract $filter, string $sort = null ) : Zend_Ldap_Node_Collection

Gets children of current node.

This is an online method.

Arguments
$filter
stringZend_Ldap_Filter_Abstract
$sort
string
Details
visibility
public
final
false
static
false
throws

searchSubtree

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.

Arguments
$filter
stringZend_Ldap_Filter_Abstract
$scope
integer
$sort
string
Details
visibility
public
final
false
static
false
throws

setAttribute

setAttribute( string $name, mixed $value ) : Zend_Ldap_Node

Sets a LDAP attribute.

This is an offline method.

Arguments
$name
string
$value
mixed
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

setDateTimeAttribute

setDateTimeAttribute( string $name, integer|array $value, boolean $utc = false ) : Zend_Ldap_Node

Sets a LDAP date/time attribute.

This is an offline method.

Arguments
$name
string
$value
integerarray
$utc
boolean
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

setDn

setDn( Zend_Ldap_Dn|string|array $newDn ) : Zend_Ldap_Node

Sets the new DN for this node

This is an offline method.

Arguments
$newDn
Zend_Ldap_Dnstringarray
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

setObjectClass

setObjectClass( array|string $value ) : Zend_Ldap_Node

Sets the objectClass.

This is an offline method.

Arguments
$value
arraystring
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

setPasswordAttribute

setPasswordAttribute( string $password, string $hashType = Zend_Ldap_Attribute, string $attribName = userPassword ) : Zend_Ldap_Node

Sets a LDAP password.

Arguments
$password
string
$hashType
string
$attribName
string
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

toLdif

toLdif( array $options = array ) : string

Returns a LDIF representation of the current node

Arguments
$options
array
Additional options used during encoding
Output
string
Details
visibility
public
final
false
static
false

update

update( Zend_Ldap $ldap = null ) : Zend_Ldap_Node

Sends all pending changes to the LDAP server

Arguments
$ldap
Zend_Ldap
Output
Zend_Ldap_Node
Provides a fluid interface
Details
visibility
public
final
false
static
false
throws

valid

valid( ) : boolean

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

Implements Iterator

Output
boolean
Details
visibility
public
final
false
static
false

willBeDeleted

willBeDeleted( ) : boolean

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

Output
boolean
Details
visibility
public
final
false
static
false

willBeMoved

willBeMoved( ) : boolean

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

Output
boolean
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.