Revision 321730c8
Von Moritz Bunkus vor etwa 14 Jahren hinzugefügt
SL/DB/Object.pm | ||
---|---|---|
|
||
while (my ($attribute, $value) = each %attributes) {
|
||
my $type = lc($types{$attribute} || 'text');
|
||
$value = $type eq 'boolean' ? ($value ? 't' : 'f')
|
||
: $text_column_types{$type} ? $value
|
||
: ($value || undef);
|
||
$value = $type eq 'boolean' ? ($value ? 't' : 'f')
|
||
: $text_column_types{$type} ? $value
|
||
: defined($value) && ($value eq '') ? undef
|
||
: $value;
|
||
$self->$attribute($value);
|
||
}
|
||
|
Auch abrufbar als: Unified diff
assign_attributes: nur leeren String und undef bei Zahlenspaletn auf NULL mappen, Wert 0 aber nicht