예제 #1
0
 private function getDefaultValueStringForColumn(SchemaColumn $column)
 {
     $defaultValue = $column->getDefaultValue();
     if (in_array(strtolower($column->getType()), array('int', 'tinyint'))) {
         if ($defaultValue === null) {
             return 'null';
         } else {
             if (strlen($defaultValue) == 0) {
                 return '""';
             } else {
                 return $defaultValue;
             }
         }
     } else {
         return $this->getStringFromPhpValue($defaultValue);
     }
 }
예제 #2
0
 /**
  * Is equals to another column?
  *
  * @param SchemaColumn $c
  * @return bool
  */
 public function equals(SchemaColumn $c)
 {
     return $this->getType() == $c->getType() && $this->getLength() == $c->getLength() && $this->getAutoIncrement() == $c->getAutoIncrement() && $this->getPrimary() == $c->getPrimary() && $this->getIndex() == $c->getIndex() && $this->getNull() == $c->getNull() && $this->getName() == $c->getName() && $this->equalsForeign($c);
 }