Prado\Data\ActiveRecord\TActiveRecordGateway::getInsertValues PHP Method

getInsertValues() protected method

protected getInsertValues ( TActiveRecord $record ) : array
$record TActiveRecord
return array insert values.
    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;
    }