protected function _getPortableTableColumnDefinition($tableColumn)
 {
     /*
      * {@inheritdoc}
      */
     $column = parent::_getPortableTableColumnDefinition($tableColumn);
     $tableColumn = array_change_key_case($tableColumn, CASE_LOWER);
     $dbType = strtolower($tableColumn['type']);
     $dbType = strtok($dbType, '(), ');
     switch ($dbType) {
         case 'enum':
             preg_match('/enum\\((.*?)\\)/', $tableColumn['type'], $matches);
             if (!empty($matches['1'])) {
                 $column->setPlatformOption('enumAllowed', $matches[1]);
                 //preg_split('/,\s?(?![^()]*\))/', $matches[1])
             }
             break;
     }
     $column->setPlatformOption('typeFromDb', $dbType);
     return $column;
 }
Example #2
0
 /**
  * Return a list of all tables in the current database
  *
  * @return array
  */
 public function listTableNames()
 {
     $options = \XLite::getInstance()->getOptions('database_details');
     return preg_grep('/^' . preg_quote($options['table_prefix'], '.+/') . '/Ss', parent::listTableNames());
 }