protected function getInsertValues(TActiveRecord $record)
{
$values = array();
$tableInfo = $this->getCommand($record)->getTableInfo();
foreach ($tableInfo->getColumns() as $name => $column) {
if ($column->getIsExcluded()) {
continue;
}
$value = $record->getColumnValue($name);
if (!$column->getAllowNull() && $value === null && !$column->hasSequence() && $column->getDefaultValue() === TDbTableColumn::UNDEFINED_VALUE) {
throw new TActiveRecordException('ar_value_must_not_be_null', get_class($record), $tableInfo->getTableFullName(), $name);
}
if ($value !== null) {
$values[$name] = $value;
}
}
return $values;
}