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:

Data Model Questions /

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

take a request on each element of an Parent.


Go to End


1353 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.