Hi there i have the following object:
// JobSchedule.php
class JobSchedule extends DataObject {
public static $db = array(
'JobDate'=>'Date',
'Category'=>'Enum("Leak,Sanitary,Blocked drain")',
'Description'=>'Text',
'Status'=>'Enum("Active,Complete,Cancelled")',
'Start'=>'Time',
'End'=>'Time',
);
}
// Calendar.php
public function PlumberResults() {
$jobs = JobSchedule::get()->groupBy('Category');
return $jobs;
}
When i use this i get the following error: [User Error] Uncaught Exception: Object->__call(): the method 'groupby' does not exist on 'DataList'
How do i go about grouping objects?