7913 Posts in 1355 Topics by 930 members
|Go to End|
13 January 2010 at 3:33pm Last edited: 13 January 2010 3:33pm
Event hasMany Registration hasOne Member
$regTablefield = new DataObjectManager(
'Member.Nickname' => 'Username',
'Member.FirstName' => 'First Name',
'Member.Surname' => 'Surname',
'Member.DateOfBirth' => 'DOB',
'Paid' => 'Paid'
"`EventID` = '$this->ID'"
$regTablefield->setAddTitle( 'Attendee' );
$fields->addFieldToTab( 'Root.Content.Registrations', $regTablefield );
DataObjectManager supports drop-down custom filters, but as far as I can tell this will simply filter exact matches. What I'd like to be able to do is have a filter for example that will list all Registrations in which the Member will be less than 18 at the time of the event (using Member.DateOfBirth and Event.StartDate).
Is this possible using DataObjectManager?
22 March 2010 at 12:52pm Last edited: 24 March 2010 7:02am
You can use DataObject::get() to retrieve a set of filtered results then use toDropDownMap().
'Filter by category',
Edit: Some good advice from UC: Check get() returns something first rather than blindly passing the results to toDropDownTable() or there could be fatal consequences (for your CMS, not you).
|Go to Top|