public static function getType($key, \MwbExporter\Core\Model\Column $column) { $return = '"' . (isset(self::$datatypes[$key]) ? self::$datatypes[$key] : 'unknown') . '"'; $config = $column->getConfig(); if ( isset($config['scale']) && $config['scale'] != -1 && isset($config['precision']) && $config['precision'] != -1 ){ $return = $return . ',scale=' . $config['scale'] . ',precision=' . $config['precision']; } if( isset($config['length']) && $config['length'] != -1 && self::$datatypes[$key] == 'string'){ $return = $return . ',length=' . $config['length']; } // handle enums if($key === 'com.mysql.rdbms.mysql.datatype.enum'){ $return .= "\n"; $return .= " values: " . str_replace(array('(',')'), array('[',']'), $config['datatypeExplicitParams']); } // handle sets // @TODO D2A sets are not supported by Doctrine if($key === 'com.mysql.rdbms.mysql.datatype.set'){ $return .= "\n"; $return .= " values: " . str_replace(array('(',')'), array('[',']'), $config['datatypeExplicitParams']); } return $return; }
public function __construct($data, $parent) { parent::__construct($data, $parent); }