[Dbix-class] method as accessor?

Steve Francia steve at takkle.com
Tue Jul 3 21:41:31 GMT 2007


I am trying to write a function for a result set that will be available
like an accessor...

Here is the scenario and goal:
I have a object of which there are two columns in the table, full_name
and alias.
I want to use $obj->name to access the name for which there would be
logic saying return full_name unless alias has a value, then return alias.

What is the best way to go about doing this? Am I on the right track?

Thanks,
Steve

-- 
Steve Francia
Lead Developer
Takkle, Inc.
212.792.5859 (fax)
steve at takkle.com




More information about the Dbix-class mailing list