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.

Data Model Questions /

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

Datalists, write() and SS3


Go to End


2 Posts   1438 Views

Avatar
alexyoungs

Community Member, 5 Posts

6 June 2012 at 3:43am

Hi folks,

I'm scratching my head a little bit trying to figure out what the Datalist equivalent of the following is:

$member = new Member();
$member->Name = "Alex";
$member->write();
$member->login();

When I execute this, I keep getting "the method 'write' does not exist on 'DataList'". I'm either missing something completely obvious or the documentation isn't great for the new ORM.

Can anyone help?!

Cheers,

Alex

Avatar
swaiba

Forum Moderator, 1899 Posts

6 June 2012 at 5:40am

Hi Alex,

The issue is that Member is extended from DataObject, not DataObjectSet. Datalist is replacing DataObjectSet. I'm no expert but I think DataObject is not changed too much.