jdtoronto has asked for the wisdom of the Perl Monks concerning the following question:
After receiving the use ClassDBI mantra as a seemingly subliminal message from the monastery over some months I have now decided to try it. ne section of my major web-app is no complete and so I have some time to learn something new.
In fact object orientation is something new to this monk! I have written this subclass which I seem to be able to make work after a fashion.
Now, in my run_mode I have this code:package User; use Class::DBI::AsForm; use Class::DBI::Iterator; use base 'Class::DBI::mysql'; use strict; use warnings; __PACKAGE__->set_db('Main', 'DBI:mysql:appsys', 'root', ''); __PACKAGE__->set_up_table("ap_uprofile"); 1;
but I continually get told that the method columns cannot be found in Class::DBI::Iterator.my $self = shift; my $q = $self->query(); my $obj = User->search_like( 'upfirstname' => 'john%' ); print STDERR Dumper( $obj ); my @cols = $obj->columns; print STDERR Dumper ( @cols );
OK, so I am brain dead, but I just cannot seem to work out what is going on! Here is what I am trying to do:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Object Oriented Confusion!
by jeffa (Bishop) on Dec 11, 2003 at 20:35 UTC |