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

take a request on each element of an Parent.


Go to End


2012 Views

Avatar
derpixler

Community Member, 4 Posts

23 January 2009 at 10:41pm

hey guys

will take a request on each element of an Parent.
I think so:
$doSet = DataObject::get( "CategoryHolder","`ParentID` = '".$this->ID."'");

and i get this array,

DataObjectSet Object
(
.....[items:protected] => Array
..........(
...............[0] => CategoryHolder Object
................(
...................[record:protected] => Array
....................(
.........................[ID] => 17
.........................[ClassName] => CategoryHolder

but how i can get the children of CategoryHolder with the ID 17.

I think so:
$doSet = DataObject::get( "CategoryHolder","`ParentID` = '".$this->ID."'");
$doSet = DataObject::get( "CategoryHolder","`ParentID` = '".$doSet->ID."'");

but the $doSet->ID is empty.