You are here

private function SimpleLdapServerSchema::getMayAttributes in Simple LDAP 8

Return a list of attributes specified as MAY for the objectclass.

Parameters

string $objectclass: The objectclass to query for attributes.

boolean $recursive: If TRUE, the attributes of the parent objectclasses will also be retrieved.

Return value

array A list of the MAY attributes.

Throws

SimpleLdapException

1 call to SimpleLdapServerSchema::getMayAttributes()
SimpleLdapServerSchema::getAttributesByObjectClass in src/SimpleLdapServerSchema.php
Return a list of attributes defined for the objectclass.

File

src/SimpleLdapServerSchema.php, line 407
Contains \Drupal\simple_ldap\SimpleLdapServerSchema

Class

SimpleLdapServerSchema

Namespace

Drupal\simple_ldap

Code

private function getMayAttributes($objectclass, $recursive = FALSE) {
  $oc = $this
    ->getSchemaItem('objectclasses', $objectclass);
  $may = array();
  if (isset($oc['may'])) {
    $may = $oc['may'];
  }
  if ($recursive && isset($oc['sup'])) {
    foreach ($oc['sup'] as $sup) {
      $may = array_merge($may, $this
        ->getMayAttributes($sup, TRUE));
    }
  }
  return $may;
}