sub column_required {
my ($class, $colname) = @_;
- $colname or $class->_croak( "Need a column for column_nullable" );
+ $colname or $class->_croak( "Need a column for column_required" );
$class->_column_info() unless ref $class->COLUMN_INFO;
if ($class->_isa_class($colname)) {
return $class->_isa_class($colname)->column_required($colname);
warn "$colname is not a recognised column in this class ", ref $class || $class, "\n";
return undef;
}
- return $class->COLUMN_INFO->{$colname}{required} || 0;
+ return $class->COLUMN_INFO->{$colname}{required} if ($class->COLUMN_INFO and $class->COLUMN_INFO->{$colname});
+ return 0;
}
=head2 column_nullable
warn "$colname is not a recognised column in this class ", ref $class || $class, "\n";
return undef;
}
- return $class->COLUMN_INFO->{$colname}{nullable} || 0;
+ return $class->COLUMN_INFO->{$colname}{nullable} if ($class->COLUMN_INFO and $class->COLUMN_INFO->{$colname});
+ return 0;
}
=head2 column_default
return undef;
}
- return $class->COLUMN_INFO->{$colname}{default};
+ return $class->COLUMN_INFO->{$colname}{default} if ($class->COLUMN_INFO and $class->COLUMN_INFO->{$colname});
+ return;
}
=head2 get_classmetadata