Exemplo n.º 1
0
 /**
  * @param Field $field
  * @param bool $isDrop
  * @return string
  */
 private function getForeignKeyName(Field $field, $isDrop = false)
 {
     $foreign = $field->getForeign();
     $name = $field->getName();
     if (!empty($foreign->getName())) {
         $name = $foreign->getName();
     }
     if ($isDrop && empty($foreign->getName())) {
         $name = str_replace(array('-', '.'), '_', sprintf("%s_%s_foreign", $this->table->getName(), $field->getName()));
     }
     return $name;
 }
 public static function isEnum(Field $field)
 {
     return in_array($field->getType(), ['enum']);
 }