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

SapphireTest with cyclic YAML file


Go to End


2 Posts   1311 Views

Avatar
wee-man

Community Member, 21 Posts

1 December 2012 at 10:13pm

Hello,

I'm currently writing tests and found a problem using the YAML object definition. E.g. the following:

item4:
        Title: Test Item 4
        FirstChild: =>Item.item5
        Next: =>Item.item6

item5:
        Title: Test Item 5
        Parent: =>Item.item4

leads to the error

Undefined index: item5
.

Is there a way to define cyclic relations inside the YAML file?

Greetings
Michael

Avatar
Willr

Forum Moderator, 5523 Posts

2 December 2012 at 5:19pm

AFAIK, no you can't have cyclic objects in SilverStripe YAML system.