Ejemplo n.º 1
0
 /**
  * Adds a column to current create query
  * 
  * @param string $name    The column name
  * @param array  $options Column definitions (size, type, etc..)
  *
  * @return \Slick\Database\Query\Ddl\Create A self instance for method
  *  call cahins
  */
 public function addColumn($name, $options = array())
 {
     $options['name'] = $name;
     $this->_columns->append(new Utility\Column($options));
     return $this;
 }
Ejemplo n.º 2
0
 /**
  * Sets an index to be deleted
  * 
  * @param string $column The column name
  * 
  * @return \Slick\Database\Query\Ddl\Alter
  */
 public function dropIndex($column)
 {
     $idx = new Index(array('name' => "{$column}_idx", 'indexColumns' => array($column)));
     $this->_droppedIndexes->append($idx);
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * Returns the foreign keys on this data definition
  * 
  * @return \Slick\Database\Query\Ddl\Utility\ElementList A ForeignKey list
  * 
  * @see  Slick\Database\Query\Ddl\Utility::ForeignKey
  */
 public function getForeignKeys()
 {
     $frks = new ElementList();
     $this->getLines();
     foreach ($this->_frks as $line) {
         $frk = $this->_parseForeignKey($line);
         if ($frk) {
             $frks->append($frk);
         }
     }
     return $frks;
 }