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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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   3139 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