I've got dataObject with a column called attributes and with that there are three options that it can hold (Event, Membership, Course). When I get to a summary page I' wishing to show these in different control blocks. In which I'm using a function like this in the controller;
function getEvents() {
$events = getCart()->find('attrib', 'event');
return $events ;
}
and in my template i'm using;
<% if getEvents %>
<% control getEvents %>
<h2>$title</h2>
<p>$date</p>
<% end_control %>
<% end_if %>
Now the problem is I'm having is the getEvents function only returns me one object, where I know there is more than one.
This page http://doc.silverstripe.com/doku.php?id=dataobjectset mentions that it returns Multiple elements.
I'm sorry if this is a basic question I'm new to Silverstripe and php class's so its all a bit above me at the moment.
Thanks in advance.