Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: (z) SUPER and Class::DBI

by duct_tape (Hermit)
on Dec 30, 2003 at 22:27 UTC ( #317796=note: print w/replies, xml ) Need Help??


in reply to (z) SUPER and Class::DBI

I believe that SUPER:: isn't going to work because that would be trying to call the password method from whatever your class is inheriting from. ie: Class::DBI. (not 100% positive on that). Since the password method is going to exist in your current package, you are overwriting it and SUPER:: will not work.

CDBI uses Class::Accessor to handle the accessor/mutator creation. When it creates an accessor it creates an alias to it called _WHATEVER_accessor. So you can do this instead:

return $self->_password_accessor(@_)

However that this will not work when using create or find_or_create. Only for modification. I would go for the trigger option instead. If you are going to use triggers you can use before_create and before_set_password.

The one other method you can do is create a class for the passwords, and then set a has_a relationship for the password column. Since this is a fairly simple task, that may be overkill. But it is something to think about.

-Brad

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://317796]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2019-09-23 20:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (285 votes). Check out past polls.

    Notices?