Пример #1
0
 /**
  * Create array with all columns types.
  *
  * @param array[]|ColumnMetadata $properties The metadata of the column.
  * @param null|string            $typePrefix Prefix for column type name.
  */
 public function extendColumnTypes($properties, $typePrefix)
 {
     $columnTypes = $properties->getProperties();
     foreach ($columnTypes as $typeName => $typeValue) {
         if ($typeName == 'column_name') {
             if (!isset($this->columnTypes['column_name'])) {
                 $this->columnTypes[$typeName] = $typeValue;
             }
         } else {
             $format = '%s_%s';
             if (isset($typePrefix)) {
                 $this->columnTypes[sprintf($format, $typePrefix, $typeName)] = $typeValue;
             } else {
                 $this->columnTypes[$typeName] = $typeValue;
             }
         }
     }
 }
Пример #2
0
 /**
  * Appends a table column to the table columns.
  *
  * @param ColumnMetadata $column The metadata of the table columns.
  */
 public function appendTableColumn($column)
 {
     $this->columns[$column->getProperty('column_name')] = $column;
 }