You are here

public function SimpleLdapSchema::may in Simple LDAP 7.2

Same name and namespace in other branches
  1. 7 SimpleLdapSchema.class.php \SimpleLdapSchema::may()

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

@throw SimpleLdapException

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.

1 call to SimpleLdapSchema::may()
SimpleLdapSchema::attributes in ./SimpleLdapSchema.class.php
Return a list of attributes defined for the objectclass.

File

./SimpleLdapSchema.class.php, line 261
Class to represent an LDAP server schema.

Class

SimpleLdapSchema
Simple LDAP Schema class.

Code

public function may($objectclass, $recursive = FALSE) {
  $oc = $this
    ->get('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
        ->may($sup, TRUE));
    }
  }
  return $may;
}