Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: DBIx::Class creating get_* and set_* methods

by emazep (Priest)
on Feb 08, 2008 at 06:39 UTC ( [id://666914]=note: print w/replies, xml ) Need Help??


in reply to DBIx::Class creating get_* and set_* methods

DBIx::Class offers also the set_column and get_column accessors:
$person->set_column('name', 'John'); $name = $person->get_column('name');
It's not exactly what you were asking for, but just in case you feel more comfortable with the get/set prefixes anyway ;-)

Update

It must be specified that they don't have exactly the same semantics of the generated accessors (see the jrockway's reply and the DBIx::Class docs.)

Cheers,
Emanuele.

Replies are listed 'Best First'.
Re^2: DBIx::Class creating get_* and set_* methods
by jrockway (Acolyte) on Feb 08, 2008 at 07:08 UTC
    Never use get_column and set_column directly unless you know what the side-effects are. They don't work the same way as using the accessors. Inflation is skipped, resultsets are not returned for relationships, etc.
      Never use get_column and set_column directly unless you know what the side-effects are.
      I would rather say "the absence of side-effects" ;-)
      (That's exactly why I often use them and I find them perfectly adequate to get the columns raw values.)

      Anyway you are right, I should have specified that's not exactly the same semantics of the generated accessors.

      Cheers,
      Emanuele.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-20 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found