Subject: | model search/delete methods model and subclassing the cdbi model |
Problems with clashing delete/search methods can occur when subclassing
the cdbi model, as class::dbi and any equivilent will use these methodnames.
Matt S Trout has provided a quick fix that will enable subclassing to
work nicer..
my ($sub) = (caller(1))[3];
$sub =~ /^(.+)::([^:]+)$/;
# So subclasses can still send search down ...
return shift->SUPER::search(@_) if ($1 ne "Maypole::Model::Base" &&
$2 ne "search");
It is reccomended that you use the new do_search/do_delete model methods
to avoid method resolution clashes.