diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Ldap/Node/Schema/ObjectClass/OpenLdap.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Ldap/Node/Schema/ObjectClass/OpenLdap.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,175 @@ +name; + } + + /** + * Gets the objectClass OID + * + * @return string + */ + public function getOid() + { + return $this->oid; + } + + /** + * Gets the attributes that this objectClass must contain + * + * @return array + */ + public function getMustContain() + { + if ($this->_inheritedMust === null) { + $this->_resolveInheritance(); + } + return $this->_inheritedMust; + } + + /** + * Gets the attributes that this objectClass may contain + * + * @return array + */ + public function getMayContain() + { + if ($this->_inheritedMay === null) { + $this->_resolveInheritance(); + } + return $this->_inheritedMay; + } + + /** + * Resolves the inheritance tree + * + * @return void + */ + protected function _resolveInheritance() + { + $must = $this->must; + $may = $this->may; + foreach ($this->getParents() as $p) { + $must = array_merge($must, $p->getMustContain()); + $may = array_merge($may, $p->getMayContain()); + } + $must = array_unique($must); + $may = array_unique($may); + $may = array_diff($may, $must); + sort($must, SORT_STRING); + sort($may, SORT_STRING); + $this->_inheritedMust = $must; + $this->_inheritedMay = $may; + } + + /** + * Gets the objectClass description + * + * @return string + */ + public function getDescription() + { + return $this->desc; + } + + /** + * Gets the objectClass type + * + * @return integer + */ + public function getType() + { + if ($this->structural) { + return Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_STRUCTURAL; + } else if ($this->abstract) { + return Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_ABSTRACT; + } else if ($this->auxiliary) { + return Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_AUXILIARY; + } else { + return Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_UNKNOWN; + } + } + + /** + * Returns the parent objectClasses of this class. + * This includes structural, abstract and auxiliary objectClasses + * + * @return array + */ + public function getParentClasses() + { + return $this->sup; + } + + /** + * Returns the parent object classes in the inhertitance tree if one exists + * + * @return array of Zend_Ldap_Node_Schema_ObjectClass_OpenLdap + */ + public function getParents() + { + return $this->_parents; + } +} \ No newline at end of file