Skip to content
Browse files

Merge branch 'MDL-29668_20' of git://github.com/stronk7/moodle into M…

…OODLE_20_STABLE
  • Loading branch information...
2 parents dbd95c2 + 8f24208 commit 9f46908ac48b03c632fdcca5b15146622bfe132b @samhemelryk samhemelryk committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/xmldb/xmldb_key.php
View
8 lib/xmldb/xmldb_key.php
@@ -59,7 +59,7 @@ function setAttributes($type, $fields, $reftable=null, $reffields=null) {
/**
* Set all the attributes of one xmldb_key
*
- * @param string type XMLDB_KEY_PRIMARY, XMLDB_KEY_UNIQUE, XMLDB_KEY_FOREIGN
+ * @param string type XMLDB_KEY_[PRIMARY|UNIQUE|FOREIGN|FOREIGN_UNIQUE]
* @param array fields an array of fieldnames to build the key over
* @param string reftable name of the table the FK points to or null
* @param array reffields an array of fieldnames in the FK table or null
@@ -418,6 +418,9 @@ function getPHP() {
case XMLDB_KEY_FOREIGN:
$result .= 'XMLDB_KEY_FOREIGN' . ', ';
break;
+ case XMLDB_KEY_FOREIGN_UNIQUE:
+ $result .= 'XMLDB_KEY_FOREIGN_UNIQUE' . ', ';
+ break;
}
/// The fields
$keyfields = $this->getFields();
@@ -427,7 +430,8 @@ function getPHP() {
$result .= 'null';
}
/// The FKs attributes
- if ($this->getType() == XMLDB_KEY_FOREIGN) {
+ if ($this->getType() == XMLDB_KEY_FOREIGN ||
+ $this->getType() == XMLDB_KEY_FOREIGN_UNIQUE) {
/// The reftable
$reftable = $this->getRefTable();
if (!empty($reftable)) {

0 comments on commit 9f46908

Please sign in to comment.
Something went wrong with that request. Please try again.