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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Uploadify import image removes image from other page


Go to End


10 Posts   3348 Views

Avatar
klikhier

Community Member, 150 Posts

10 March 2011 at 9:42am

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

Forum Moderator, 4102 Posts

10 March 2011 at 10:03am

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'

Go to Top