PHP Class LdapTools\Object\LdapObjectCreator

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

Protected Properties

Property Type Description
$attributes array
$connection LdapTools\Connection\LdapConnectionInterface
$container string
$dispatcher LdapTools\Event\EventDispatcherInterface
$dn An explicitly set distinguished name.
$hydrator LdapTools\Hydrator\OperationHydrator
$parameters Any explicitly set parameter values are stored here.
$schema LdapTools\Schema\LdapObjectSchema
$schemaFactory LdapTools\Factory\LdapObjectSchemaFactory
$server A specific server to execute the LDAP object creation against.

Public Methods

Method Description
__construct ( LdapTools\Connection\LdapConnectionInterface $connection, LdapObjectSchemaFactory $schemaFactory, LdapTools\Event\EventDispatcherInterface $dispatcher )
create ( string | LdapObjectSchema $type ) Specify the object type to create. Either by its string name type from the schema of the LdapObjectSchema.
createComputer ( ) Shorthand method for creating a computer LDAP object.
createContact ( ) Shorthand method for creating a contact LDAP object.
createGroup ( ) Shorthand method for creating a group LDAP object.
createOU ( ) Shorthand method for creating an OU LDAP object.
createUser ( ) Shorthand method for creating a generic user type.
execute ( ) Add the object with the selected attributes into LDAP.
getServer ( ) : string | null Get an explicit LDAP server to execute against, if any is set.
in ( $container ) Sets the OU/container the object will be created in.
setDn ( string $dn ) Explicitly set the DN to use when adding it to LDAP.
setParameter ( string $parameter, mixed $value ) Set a value for a specific placeholder in the schema, or in any values you added (ie. Anything enclosed within percentage signs such as %placeholder%).
setServer ( string $server ) Set an explicit LDAP server to execute against.
with ( array $attributes ) Sets the attributes the object will be created with.

Protected Methods

Method Description
getAddOperation ( ) : AddOperation Get the add operation and take care of the hydration process.
triggerAfterCreationEvent ( AddOperation $operation ) Trigger a LDAP object after creation event.
triggerBeforeCreationEvent ( ) Trigger a LDAP object before creation event.

Method Details

__construct() public method

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

create() public method

Specify the object type to create. Either by its string name type from the schema of the LdapObjectSchema.
public create ( string | LdapObjectSchema $type )
$type string | LdapTools\Schema\LdapObjectSchema

createComputer() public method

Shorthand method for creating a computer LDAP object.
public createComputer ( )

createContact() public method

Shorthand method for creating a contact LDAP object.
public createContact ( )

createGroup() public method

Shorthand method for creating a group LDAP object.
public createGroup ( )

createOU() public method

Shorthand method for creating an OU LDAP object.
public createOU ( )

createUser() public method

Shorthand method for creating a generic user type.
public createUser ( )

execute() public method

Add the object with the selected attributes into LDAP.
public execute ( )

getAddOperation() protected method

Get the add operation and take care of the hydration process.
protected getAddOperation ( ) : AddOperation
return LdapTools\Operation\AddOperation

getServer() public method

Get an explicit LDAP server to execute against, if any is set.
public getServer ( ) : string | null
return string | null

in() public method

Sets the OU/container the object will be created in.
public in ( $container )
$container

setDn() public method

Explicitly set the DN to use when adding it to LDAP.
public setDn ( string $dn )
$dn string

setParameter() public method

Set a value for a specific placeholder in the schema, or in any values you added (ie. Anything enclosed within percentage signs such as %placeholder%).
public setParameter ( string $parameter, mixed $value )
$parameter string
$value mixed

setServer() public method

Set an explicit LDAP server to execute against.
public setServer ( string $server )
$server string

triggerAfterCreationEvent() protected method

Trigger a LDAP object after creation event.
protected triggerAfterCreationEvent ( AddOperation $operation )
$operation LdapTools\Operation\AddOperation

triggerBeforeCreationEvent() protected method

Trigger a LDAP object before creation event.

with() public method

Sets the attributes the object will be created with.
public with ( array $attributes )
$attributes array

Property Details

$attributes protected property

protected array $attributes
return array

$connection protected property

protected LdapConnectionInterface,LdapTools\Connection $connection
return LdapTools\Connection\LdapConnectionInterface

$container protected property

protected string $container
return string

$dispatcher protected property

protected EventDispatcherInterface,LdapTools\Event $dispatcher
return LdapTools\Event\EventDispatcherInterface

$dn protected property

An explicitly set distinguished name.
protected $dn

$hydrator protected property

protected OperationHydrator,LdapTools\Hydrator $hydrator
return LdapTools\Hydrator\OperationHydrator

$parameters protected property

Any explicitly set parameter values are stored here.
protected $parameters

$schema protected property

protected LdapObjectSchema,LdapTools\Schema $schema
return LdapTools\Schema\LdapObjectSchema

$schemaFactory protected property

protected LdapObjectSchemaFactory,LdapTools\Factory $schemaFactory
return LdapTools\Factory\LdapObjectSchemaFactory

$server protected property

A specific server to execute the LDAP object creation against.
protected $server