/** * Get timestamp of the last_status according to LP * * @param srCertificate $cert * @return int|null */ protected function getLastLPStatus(srCertificate $cert) { $ref_id = $cert->getDefinition()->getRefId(); $obj_id = ilObject::_lookupObjectId($ref_id); $lp_data = ilTrQuery::getObjectsDataForUser($cert->getUserId(), $obj_id, $ref_id, '', '', 0, 9999, null, array('last_access')); $last_status = null; foreach ($lp_data['set'] as $data) { if ($data['type'] == 'crs') { $last_status = $data['last_access']; break; } } return (int) $last_status; }