sub search : Exported {
my $self = shift;
my ($sub) = (caller(1))[3];
- $sub =~ /^(.+)::([^:]+)$/;
# So subclasses can still send search down ...
- return ($1 ne "Maypole::Model::Base" && $2 ne "search") ?
- $self->SUPER::search(@_) : $self->do_search(@_);
+ if ($sub =~ /^(.+)::([^:]+)$/) {
+ return ($1 ne "Maypole::Model::Base" && $2 ne "search") ?
+ $self->SUPER::search(@_) : $self->do_search(@_);
+ } else {
+ $self->SUPER::search(@_);
+ }
}
sub do_search : Exported {
$class->related_meta($col);
-Given a column associated with a relationship it will return the relatation
-ship type and the meta info for the relationship on the column.
+Returns the hash ref of relationship meta info for a given column.
=cut
my $class_meta = $self->meta_info;
if (my ($rel_type) = grep { defined $class_meta->{$_}->{$accssr} }
keys %$class_meta)
- { return $rel_type, $class_meta->{$rel_type}->{$accssr} };
+ { return $class_meta->{$rel_type}->{$accssr} };
}
my $info = $class->_column_info->{$col} ||
eval { $class->_isa_class($col)->_column_info($col) } ||
return '';
-
+
my $def = $info->{COLUMN_DEF};
- $def = '' unless defined $def;
-
- # exclude defaults we don't want to display-- may need some additions here
- if ( $class->column_type($col) =~ /^BOOL/i ) {
- $def = $def ? 1 : 0; # allow 0 or 1 for bool cols
- }
- else {
- $def = $def =~ /(^0000-00-00.*$|^0[0]*$|^0\.00$|CURRENT_TIMESTAMP|NULL)/i ? '' : $def ;
-
- }
- return $def;
+ $def = '' unless defined $def; # is this good?
+ return $def;
}
+
+
=head2 get_classmetadata
Gets class meta data *excluding cgi input* for the passed in class or the