PHP Class LdapTools\Object\LdapObjectManager

Author: Chad Sikorra ([email protected])
Afficher le fichier Open project: ldaptools/ldaptools

Protected Properties

Свойство Type Description
$connection LdapTools\Connection\LdapConnectionInterface
$dispatcher LdapTools\Event\EventDispatcherInterface
$schemaFactory LdapTools\Factory\LdapObjectSchemaFactory

Méthodes publiques

Méthode Description
__construct ( LdapTools\Connection\LdapConnectionInterface $connection, LdapObjectSchemaFactory $schemaFactory, LdapTools\Event\EventDispatcherInterface $dispatcher )
delete ( LdapObject $ldapObject, boolean $recursively = false ) Removes an object from LDAP.
move ( LdapObject $ldapObject, string $container ) Moves an object from one container/OU to another in LDAP.
persist ( LdapObject $ldapObject ) Updates an object in LDAP. It will only update attributes that actually changed on the object.
restore ( LdapObject $ldapObject, null | string $location = null ) Restore a deleted LDAP object. Optionally pass the new location container/OU for the object. If a new location is not provided it will use the lastKnownParent value to determine where it should go.

Méthodes protégées

Méthode Description
executeBatchOperation ( LdapObject $ldapObject, string | null $dn = null )
getObjectRestoreLocation ( LdapObject $ldapObject, string | null $location ) : string It's possible a new location was not explicitly given and the attribute that contains the last know location was not queried for when the object was originally found. In that case attempt to retrieve the last known location from a separate LDAP query.
hydrateOperation ( BatchModifyOperation $operation, string $type ) Get the batch modification array that ldap_modify_batch expects.
validateObject ( LdapObject $ldapObject ) The DN attribute must be present to perform LDAP operations.

Method Details

__construct() public méthode

public __construct ( LdapTools\Connection\LdapConnectionInterface $connection, LdapObjectSchemaFactory $schemaFactory, LdapTools\Event\EventDispatcherInterface $dispatcher )
$connection LdapTools\Connection\LdapConnectionInterface
$schemaFactory LdapTools\Factory\LdapObjectSchemaFactory
$dispatcher LdapTools\Event\EventDispatcherInterface

delete() public méthode

Removes an object from LDAP.
public delete ( LdapObject $ldapObject, boolean $recursively = false )
$ldapObject LdapObject
$recursively boolean

executeBatchOperation() protected méthode

protected executeBatchOperation ( LdapObject $ldapObject, string | null $dn = null )
$ldapObject LdapObject
$dn string | null The DN to use for the batch operation to LDAP.

getObjectRestoreLocation() protected méthode

It's possible a new location was not explicitly given and the attribute that contains the last know location was not queried for when the object was originally found. In that case attempt to retrieve the last known location from a separate LDAP query.
protected getObjectRestoreLocation ( LdapObject $ldapObject, string | null $location ) : string
$ldapObject LdapObject
$location string | null
Résultat string

hydrateOperation() protected méthode

Get the batch modification array that ldap_modify_batch expects.
protected hydrateOperation ( BatchModifyOperation $operation, string $type )
$operation LdapTools\Operation\BatchModifyOperation
$type string

move() public méthode

Moves an object from one container/OU to another in LDAP.
public move ( LdapObject $ldapObject, string $container )
$ldapObject LdapObject
$container string

persist() public méthode

Updates an object in LDAP. It will only update attributes that actually changed on the object.
public persist ( LdapObject $ldapObject )
$ldapObject LdapObject

restore() public méthode

This may require a strategy design at some point, as this is AD specific currently. Unsure as to how other directory services handle deleted object restores. The basic logic for AD to do this is... 1. Reset the 'isDeleted' attribute. 2. Set the DN so the object ends up in a location other than the "Deleted Objects" container.
public restore ( LdapObject $ldapObject, null | string $location = null )
$ldapObject LdapObject
$location null | string The DN of a container/OU where the restored object should go.

validateObject() protected méthode

The DN attribute must be present to perform LDAP operations.
protected validateObject ( LdapObject $ldapObject )
$ldapObject LdapObject

Property Details

$connection protected_oe property

protected LdapConnectionInterface,LdapTools\Connection $connection
Résultat LdapTools\Connection\LdapConnectionInterface

$dispatcher protected_oe property

protected EventDispatcherInterface,LdapTools\Event $dispatcher
Résultat LdapTools\Event\EventDispatcherInterface

$schemaFactory protected_oe property

protected LdapObjectSchemaFactory,LdapTools\Factory $schemaFactory
Résultat LdapTools\Factory\LdapObjectSchemaFactory