Names for the object getters and setters?

1 view
Skip to first unread message

Beau D. Simensen

unread,
Dec 18, 2008, 6:36:13 PM12/18/08
to Outlet ORM
Is there a way to configure the names of the getters and setters for
the relationships?

I use _ packing/class naming conventions ( s3a_feed_Feed ) but would
like to have the option to use methods and properties named more after
the end of the package ( i.e., the "Class Name" ) for my
relationships. For example, I would like to be able to use getFeeds()
instead of gets3a_feed_Feeds() ...

Short of specifying the name of the getters and setters directly
( looks like three, get*, set* and add* ), I'd be satisfied to just
specify the singular name to override the class name ( i.e., I could
specify "Feed" to override the class name of "s3a_feed_Feed" )...

Thanks!

Alvaro Carrasco

unread,
Dec 18, 2008, 9:37:58 PM12/18/08
to outle...@googlegroups.com
You can do that on the options for the association. Use the 'name' option:
...
array('one-to-many', 's3a_feed_Feed', array('key'=>'WhateverTheKeyIs',
'name'=>'Feed'))
...

That should create methods: setFeeds, getFeeds, addFeed.

Check out this page:
http://www.outlet-orm.org/manual/ch04.html#d0e234

I should probably add some examples of that to the manual.

Alvaro

Beau D. Simensen

unread,
Dec 19, 2008, 12:12:41 AM12/19/08
to Outlet ORM
Thanks, Alvaro!

I guess I could have looked at the docs more closely. But yeah,
examples would be awesome!
Reply all
Reply to author
Forward
0 new messages