LdapTools\Schema\LdapObjectSchema::setAttributeMap PHP Method

setAttributeMap() public method

Set the map of names to actual LDAP attribute names.
public setAttributeMap ( array $attributeMap )
$attributeMap array
    public function setAttributeMap(array $attributeMap)
    {
        $this->attributeMap = $attributeMap;
    }

Usage Example

 function let(LdapConnectionInterface $connection, AddOperation $operation)
 {
     $schema = new LdapObjectSchema('ad', 'user');
     $schema->setAttributeMap(['username' => 'sAMAccountName', 'emailAddress' => 'mail', 'disabled' => 'userAccountControl', 'passwordMustChange' => 'pwdLastSet', 'passwordNeverExpires' => 'userAccountControl', 'trustedForAllDelegation' => 'userAccountControl', 'groups' => 'memberOf']);
     $schema->setConverterMap(['disabled' => 'user_account_control', 'passwordMustChange' => 'password_must_change', 'trustedForAllDelegation' => 'user_account_control', 'passwordNeverExpires' => 'user_account_control', 'groups' => 'group_membership']);
     $schema->setConverterOptions(['user_account_control' => ['uacMap' => ['disabled' => '2', 'passwordNeverExpires' => '65536', 'smartCardRequired' => '262144', 'trustedForAllDelegation' => '524288', 'passwordIsReversible' => '128'], 'defaultValue' => '512'], 'group_membership' => ['groups' => ['to_attribute' => 'member', 'from_attribute' => 'memberOf', 'attribute' => 'sAMAccountName', 'filter' => ['objectClass' => 'group']]]]);
     $this->schema = $schema;
     $connection->getConfig()->willReturn(new DomainConfiguration('foo.bar'));
     $this->beConstructedThrough('getInstance', [$schema, $this->entryTo, AttributeConverterInterface::TYPE_CREATE]);
 }
All Usage Examples Of LdapTools\Schema\LdapObjectSchema::setAttributeMap