public function getPHP() {

        $result = '';

        // The type
        $unique = $this->getUnique();
        if (!empty($unique)) {
            $result .= 'XMLDB_INDEX_UNIQUE, ';
        } else {
            $result .= 'XMLDB_INDEX_NOTUNIQUE, ';
        }
        // The fields
        $indexfields = $this->getFields();
        if (!empty($indexfields)) {
            $result .= "['".  implode("', '", $indexfields) . "']";
        } else {
            $result .= 'null';
        }
        // Hints
        $hints = $this->getHints();
        if (!empty($hints)) {
            $result .= ", ['".  implode("', '", $hints) . "']";
        }

        // Return result
        return $result;
    }
public function getPHP() {

        $result = '';

        // The type
        $unique = $this->getUnique();
        if (!empty($unique)) {
            $result .= 'XMLDB_INDEX_UNIQUE, ';
        } else {
            $result .= 'XMLDB_INDEX_NOTUNIQUE, ';
        }
        // The fields
        $indexfields = $this->getFields();
        if (!empty($indexfields)) {
            $result .= "['".  implode("', '", $indexfields) . "']";
        } else {
            $result .= 'null';
        }
        // Hints
        $hints = $this->getHints();
        if (!empty($hints)) {
            $result .= ", ['".  implode("', '", $hints) . "']";
        }

        // Return result
        return $result;
    }
public function getPHP ( ) { $ result = '' ; // The type $ unique = $ this -> getUnique ( ) ; if ( ! empty ( $ unique ) ) { $ result .= 'XMLDB_INDEX_UNIQUE, ' ; } else { $ result .= 'XMLDB_INDEX_NOTUNIQUE, ' ; } // The fields $ indexfields = $ this -> getFields ( ) ; if ( ! empty ( $ indexfields ) ) { $ result .= "['" . implode ( "', '" , $ indexfields ) . "']" ; } else { $ result .= 'null' ; } // Hints $ hints = $ this -> getHints ( ) ; if ( ! empty ( $ hints ) ) { $ result .= ", ['" . implode ( "', '" , $ hints ) . "']" ; } // Return result return $ result ; }
Returns the PHP code needed to define one xmldb_index
@return string
Returns the PHP code needed to define one xmldb_index