public function createEnumColumn($defaultValues, $defaultValue) { $column = new Column(); $column->setType(PropelTypes::ENUM); $column->setValueSet($defaultValues); $column->setDefaultValue($defaultValue); return $column; }
public function getColumnDDL(Column $col) { if ($col->isAutoIncrement()) { $col->setType('INTEGER'); $col->setDomainForType('INTEGER'); } if ($col->getDefaultValue() && $col->getDefaultValue()->isExpression() && 'CURRENT_TIMESTAMP' === $col->getDefaultValue()->getValue()) { //sqlite use CURRENT_TIMESTAMP different than mysql/pgsql etc //we set it to the more common behavior $col->setDefaultValue(new ColumnDefaultValue("(datetime(CURRENT_TIMESTAMP, 'localtime'))", ColumnDefaultValue::TYPE_EXPR)); } return parent::getColumnDDL($col); }
public function testIsPhpArrayType() { $column = new Column(); $this->assertFalse($column->isPhpArrayType()); $column->setType(PropelTypes::PHP_ARRAY); $this->assertTrue($column->isPhpArrayType()); }