You are here

public function SimpleLdapSchema::must in Simple LDAP 7.2

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

Return a list of attributes specified as MUST 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 MUST attributes.

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

File

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

Class

SimpleLdapSchema
Simple LDAP Schema class.

Code

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