PHP Class LdapTools\Object\LdapObject

Author: Chad Sikorra ([email protected])
Datei anzeigen Open project: ldaptools/ldaptools Class Usage Examples

Protected Properties

Property Type Description
$attributes The attributes and values that represent this LDAP object.
$batches A collection of Batch objects for changes to be sent to LDAP.
$functions These are the expected "magic" function calls for the attributes.
$type The type as defined in the schema, if any.

Public Methods

Method Description
__call ( string $method, array $arguments ) : mixed Determines which function, if any, should be called.
__construct ( array $attributes, string $type = '' )
__get ( string $attribute ) : mixed Magic property getter.
__isset ( string $attribute ) : boolean Magically check for an attributes existence on an isset call.
__set ( string $attribute, mixed $value ) Magic property setter.
__toString ( ) : string
add ( string $attribute, $values ) Add an additional value, or values, to an attribute.
get ( string $attribute ) : mixed Get the value of an attribute. An attribute with multiple values will return an array of values.
getBatchCollection ( ) : BatchCollection Get the BatchCollection object.
getType ( ) : string Get the LDAP type for this object.
has ( string $attribute, mixed $value = null ) : boolean Check to see if a specific attribute exists. Optionally check if it exists with a specific value.
isType ( string $type ) : boolean Check if this LDAP Object is a specific type (Schema type).
refresh ( array $attributes ) Updates a set of attributes/values on the object without incurring a tracked modification.
remove ( string $attribute, $values ) Remove a specific value, or multiple values, from an attribute.
reset ( $attributes ) Resets the attribute, which effectively removes any values it may have.
set ( string $attribute, mixed $value ) Set a value for an attribute.
setBatchCollection ( BatchCollection $batches ) Sets the BatchCollection.
toArray ( ) : array The array representation of the LDAP object.

Protected Methods

Method Description
addAttributeValue ( mixed $value, mixed $valueToAdd ) : array Adds an additional value to an existing LDAP attribute value.
attributeHasValue ( string $attribute, mixed $value ) : boolean Check if an attribute has a specific value. Called only when the attribute is known to exist already.
removeAttributeValue ( mixed $value, mixed $valueToRemove ) : mixed Given the original value, remove if it's present.
resolveAttributeName ( string $attribute ) : string Retrieve the attribute in the case it exists in the array.

Method Details

__call() public method

Determines which function, if any, should be called.
public __call ( string $method, array $arguments ) : mixed
$method string
$arguments array
return mixed

__construct() public method

public __construct ( array $attributes, string $type = '' )
$attributes array
$type string

__get() public method

Magic property getter.
public __get ( string $attribute ) : mixed
$attribute string
return mixed

__isset() public method

Magically check for an attributes existence on an isset call.
public __isset ( string $attribute ) : boolean
$attribute string
return boolean

__set() public method

Magic property setter.
public __set ( string $attribute, mixed $value )
$attribute string
$value mixed

__toString() public method

public __toString ( ) : string
return string

add() public method

Add an additional value, or values, to an attribute.
public add ( string $attribute, $values )
$attribute string
$values

addAttributeValue() protected method

Adds an additional value to an existing LDAP attribute value.
protected addAttributeValue ( mixed $value, mixed $valueToAdd ) : array
$value mixed
$valueToAdd mixed
return array

attributeHasValue() protected method

Check if an attribute has a specific value. Called only when the attribute is known to exist already.
protected attributeHasValue ( string $attribute, mixed $value ) : boolean
$attribute string
$value mixed
return boolean

get() public method

Get the value of an attribute. An attribute with multiple values will return an array of values.
public get ( string $attribute ) : mixed
$attribute string
return mixed

getBatchCollection() public method

Get the BatchCollection object.
public getBatchCollection ( ) : BatchCollection
return LdapTools\BatchModify\BatchCollection

getType() public method

Get the LDAP type for this object.
public getType ( ) : string
return string

has() public method

Check to see if a specific attribute exists. Optionally check if it exists with a specific value.
public has ( string $attribute, mixed $value = null ) : boolean
$attribute string
$value mixed
return boolean

isType() public method

Check if this LDAP Object is a specific type (Schema type).
public isType ( string $type ) : boolean
$type string
return boolean

refresh() public method

Updates a set of attributes/values on the object without incurring a tracked modification.
public refresh ( array $attributes )
$attributes array

remove() public method

Remove a specific value, or multiple values, from an attribute.
public remove ( string $attribute, $values )
$attribute string
$values

removeAttributeValue() protected method

Given the original value, remove if it's present.
protected removeAttributeValue ( mixed $value, mixed $valueToRemove ) : mixed
$value mixed
$valueToRemove mixed
return mixed

reset() public method

Resets the attribute, which effectively removes any values it may have.
public reset ( $attributes )
$attributes

resolveAttributeName() protected method

Retrieve the attribute in the case it exists in the array.
protected resolveAttributeName ( string $attribute ) : string
$attribute string
return string

set() public method

If a value already exists it will be replaced. If the value is empty the attribute will be cleared/reset.
public set ( string $attribute, mixed $value )
$attribute string
$value mixed

setBatchCollection() public method

Sets the BatchCollection.
public setBatchCollection ( BatchCollection $batches )
$batches LdapTools\BatchModify\BatchCollection

toArray() public method

The array representation of the LDAP object.
public toArray ( ) : array
return array

Property Details

$attributes protected_oe property

The attributes and values that represent this LDAP object.
protected $attributes

$batches protected_oe property

A collection of Batch objects for changes to be sent to LDAP.
protected $batches

$functions protected_oe property

These are the expected "magic" function calls for the attributes.
protected $functions

$type protected_oe property

The type as defined in the schema, if any.
protected $type