Example #1
0
 /**
  * Adds a new index to the index list and set the
  * parent table of the column to the current table
  */
 public function addIndex($idxdata)
 {
     if ($idxdata instanceof Index) {
         $index = $idxdata;
         $index->setTable($this);
         $index->getName();
         // we call this method so that the name is created now if it doesn't already exist.
         $this->indices[] = $index;
         return $index;
     } else {
         $index = new Index($this);
         $index->loadFromXML($idxdata);
         return $this->addIndex($index);
     }
 }