public function setFromADOKey($adokey) {

        // Calculate the XMLDB_KEY
        switch (strtolower($adokey['name'])) {
            case 'primary':
                $this->type = XMLDB_KEY_PRIMARY;
                break;
            default:
                $this->type = XMLDB_KEY_UNIQUE;
        }
        // Set the fields, converting all them to lowercase
        $fields = array_flip(array_change_key_case(array_flip($adokey['columns'])));
        $this->fields = $fields;
        // Some more fields
        $this->loaded = true;
        $this->changed = true;
    }
public function setFromADOKey($adokey) {

        // Calculate the XMLDB_KEY
        switch (strtolower($adokey['name'])) {
            case 'primary':
                $this->type = XMLDB_KEY_PRIMARY;
                break;
            default:
                $this->type = XMLDB_KEY_UNIQUE;
        }
        // Set the fields, converting all them to lowercase
        $fields = array_flip(array_change_key_case(array_flip($adokey['columns'])));
        $this->fields = $fields;
        // Some more fields
        $this->loaded = true;
        $this->changed = true;
    }
public function setFromADOKey ( $ adokey ) { // Calculate the XMLDB_KEY switch ( strtolower ( $ adokey [ 'name' ] ) ) { case 'primary' : $ this -> type = XMLDB_KEY_PRIMARY ; break ; default : $ this -> type = XMLDB_KEY_UNIQUE ; } // Set the fields, converting all them to lowercase $ fields = array_flip ( array_change_key_case ( array_flip ( $ adokey [ 'columns' ] ) ) ) ; $ this -> fields = $ fields ; // Some more fields $ this -> loaded = true ; $ this -> changed = true ; }
This function will set all the attributes of the xmldb_key object
based on information passed in one ADOkey
@oaram array $adokey
This function will set all the attributes of the xmldb_key object based on information passed in one ADOkey