Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Uploadify import image removes image from other page


Reply

10 Posts   2350 Views

Avatar
klikhier

10 March 2011 at 9:42am Community Member, 150 Posts

Actually, one final Q:

Does it needs to be Pages or Page: (both seem to work)

class Photo extends Image {

static $belongs_many_many = array (
'Pages' => 'Page'
);

}

or

class Photo extends Image {

static $belongs_many_many = array (
'Page' => 'Page'
);

}

Avatar
UncleCheese

10 March 2011 at 10:03am 4085 Posts

Yeah, the key in the array is an arbitrary name for the relationship, so it won't make a difference. The value 'Page' is important because it has to refer to a data class.

To answer your question, though, as a matter of convention, it should be plural, since it returns a DataObjectSet.

'Pages' => 'Page'