/** * Factory method to create the Schema node. * * @param \Zend\Ldap\Ldap $ldap * @return \Zend\Ldap\Node\Schema * @throws \Zend\Ldap\Exception */ public static function create(Ldap\Ldap $ldap) { $dn = $ldap->getRootDse()->getSchemaDn(); $data = $ldap->getEntry($dn, array('*', '+'), true); switch ($ldap->getRootDse()->getServerType()) { case RootDSE::SERVER_TYPE_ACTIVEDIRECTORY: return new Schema\ActiveDirectory($dn, $data, $ldap); case RootDSE::SERVER_TYPE_OPENLDAP: return new Schema\OpenLdap($dn, $data, $ldap); case RootDSE::SERVER_TYPE_EDIRECTORY: default: return new self($dn, $data, $ldap); } }