public function getRecords() { if ($this->hasRecords()) { // get full reading list record data $record_data = $this->getRecordData(); // get just the id's $ids = array(); foreach ($record_data as $record_data_item) { $ids[] = $record_data_item->record_id; } // get the full Xerxes records $records_datamap = new SavedRecords(); $records = $records_datamap->getRecordsByID($ids); // print_r($record_data); print_r($records); exit; // reorder them here -- hacky sack! @todo: find a better way! $final = array(); foreach ($record_data as $record_data_item) { foreach ($records as $record) { if ($record->id == $record_data_item->record_id) { // substitute any user-supplied data if ($record_data_item->title != "") { $user_params = array('title' => $record_data_item->title, 'sub_title' => '', 'non_sort' => '', 'primary_author' => $record_data_item->author, 'journal' => $record_data_item->publication, 'abstract' => $record_data_item->description); $record->xerxes_record->setProperties($user_params); } // add them in this order $final[] = $record; break; } } } return $final; } }
public function getRecords() { if ($this->hasCourseRecords()) { $ids = $this->getCourseRecordIDs(); $records_datamap = new SavedRecords(); $records = $records_datamap->getRecordsByID($ids); // reorder them here -- hacky sack! @todo: find a better way! // print_r($ids); print_r($records); exit; $final = array(); foreach ($ids as $id) { foreach ($records as $record) { if ($record->id == $id) { $final[] = $record; break; } } } return $final; } }