You are here

public function SimpleLdapSchema::superclass in Simple LDAP 7.2

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

Returns the objectclass's superclass.

File

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

Class

SimpleLdapSchema
Simple LDAP Schema class.

Code

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