diff options
Diffstat (limited to 'FS/FS/Record.pm')
-rw-r--r-- | FS/FS/Record.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 16520f4..2e2612e 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -2589,6 +2589,20 @@ sub ut_enum { return "Illegal (enum) field $field: ". $self->getfield($field); } +=item ut_enumn COLUMN CHOICES_ARRAYREF + +Like ut_enum, except the null value is also allowed. + +=cut + +sub ut_enumn { + my( $self, $field, $choices ) = @_; + $self->getfield($field) + ? $self->ut_enum($field, $choices) + : ''; +} + + =item ut_foreign_key COLUMN FOREIGN_TABLE FOREIGN_COLUMN Check/untaint a foreign column key. Call a regular ut_ method (like ut_number) |