X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FModel%2FCDBI%2FBase.pm;h=2434284a032b3f62b11a793018073e09a30aacc2;hb=bd6da5dd49b9a50d49098f97278e4b440cb17bd9;hp=a7e7d97cf61044861ded5e22724c50d8d1ab3744;hpb=dcc33148f1b562834e16f658e34270f3f581833c;p=maypole.git diff --git a/lib/Maypole/Model/CDBI/Base.pm b/lib/Maypole/Model/CDBI/Base.pm index a7e7d97..2434284 100644 --- a/lib/Maypole/Model/CDBI/Base.pm +++ b/lib/Maypole/Model/CDBI/Base.pm @@ -145,6 +145,19 @@ sub _do_update_or_create { return $obj, $fatal, $creating; } +=head2 view + +This command shows the object using the view factory template. + +=cut + +sub view : Exported { + my ($self, $r) = @_; + $r->build_form_elements(0); + return; +} + + =head2 delete Deprecated method that calls do_delete or a given classes delete method, please @@ -166,11 +179,12 @@ sub delete : Exported { if ($1 ne "Maypole::Model::Base" && $2 ne "delete") { $self->SUPER::delete(@_); } else { - warn "Maypole::Model::CDBI delete method is deprecated\n"; + warn "Maypole::Model::CDBI::Base delete method is deprecated\n"; $self->do_delete(@_); } } + sub do_delete { my ( $self, $r ) = @_; # FIXME: handle fatal error with exception @@ -307,6 +321,21 @@ sub related_class { } } +=head2 search_columns + + $class->search_columns; + +Returns a list of columns suitable for searching - used in factory templates, over-ridden in +classes. Provides same list as display_columns unless over-ridden. + +=cut + +sub search_columns { + my $class = shift; + return $class->display_columns; +} + + =head2 related_meta $class->related_meta($col);