Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: (z) SUPER and Class::DBI

by duct_tape (Hermit)
on Dec 30, 2003 at 22:27 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://317796]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 04:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found