public function getXMLDBKeyType($type) {

        $result = XMLDB_KEY_INCORRECT;

        switch (strtolower($type)) {
            case 'primary':
                $result = XMLDB_KEY_PRIMARY;
                break;
            case 'unique':
                $result = XMLDB_KEY_UNIQUE;
                break;
            case 'foreign':
                $result = XMLDB_KEY_FOREIGN;
                break;
            case 'foreign-unique':
                $result = XMLDB_KEY_FOREIGN_UNIQUE;
                break;
            // case 'check':  //Not supported
            //     $result = XMLDB_KEY_CHECK;
            //     break;
        }
        // Return the normalized XMLDB_KEY
        return $result;
    }
public function getXMLDBKeyType($type) {

        $result = XMLDB_KEY_INCORRECT;

        switch (strtolower($type)) {
            case 'primary':
                $result = XMLDB_KEY_PRIMARY;
                break;
            case 'unique':
                $result = XMLDB_KEY_UNIQUE;
                break;
            case 'foreign':
                $result = XMLDB_KEY_FOREIGN;
                break;
            case 'foreign-unique':
                $result = XMLDB_KEY_FOREIGN_UNIQUE;
                break;
            // case 'check':  //Not supported
            //     $result = XMLDB_KEY_CHECK;
            //     break;
        }
        // Return the normalized XMLDB_KEY
        return $result;
    }
public function getXMLDBKeyType ( $ type ) { $ result = XMLDB_KEY_INCORRECT ; switch ( strtolower ( $ type ) ) { case 'primary' : $ result = XMLDB_KEY_PRIMARY ; break ; case 'unique' : $ result = XMLDB_KEY_UNIQUE ; break ; case 'foreign' : $ result = XMLDB_KEY_FOREIGN ; break ; case 'foreign-unique' : $ result = XMLDB_KEY_FOREIGN_UNIQUE ; break ; // case 'check':  //Not supported //     $result = XMLDB_KEY_CHECK; //     break; } // Return the normalized XMLDB_KEY return $ result ; }
This function returns the correct XMLDB_KEY_XXX value for the
string passed as argument
@param string $type
@return int
This function returns the correct XMLDB_KEY_XXX value for the string passed as argument