/** * Returns an available identifier for the given subtree * * @param string $dn * @param boolean $hash * @return integer|string */ protected function _getIdentifier($dn = null, $hash = false) { if ($dn && substr($dn, -1) != ',') { $dn .= ','; } $next = $this->_ressource->countChildren($dn . $this->_currentDn) + 1; return $hash ? base_convert($next, 10, 32) : $next; }