4 require_once
'Services/TermsOfService/interfaces/interface.ilTermsOfServiceAcceptanceDataGateway.php';
30 $query =
'SELECT id FROM tos_versions WHERE hash = %s AND lng = %s';
31 $res = $this->db->queryF(
33 array(
'text',
'text'),
37 if($this->db->numRows(
$res))
40 $tosv_id =
$row[
'id'];
44 $tosv_id = $this->db->nextId(
'tos_versions');
48 'id' => array(
'integer', $tosv_id),
50 'src' => array(
'text', $entity->
getSource()),
52 'text' => array(
'clob', $entity->
getText()),
53 'hash' => array(
'text', $entity->
getHash()),
60 'tos_acceptance_track',
62 'tosv_id' => array(
'integer', $tosv_id),
63 'usr_id' => array(
'integer', $entity->
getUserId()),
75 $this->db->setLimit(1, 0);
76 $res = $this->db->queryF(
' 77 SELECT tos_versions.*, tos_acceptance_track.ts accepted_ts 78 FROM tos_acceptance_track 79 INNER JOIN tos_versions ON id = tosv_id 81 ORDER BY tos_acceptance_track.ts DESC 106 $res = $this->db->queryF(
' 112 array($entity->
getId())
132 $this->db->manipulate(
'DELETE FROM tos_acceptance_track WHERE usr_id = ' . $this->db->quote($entity->
getUserId(),
'integer'));
setSourceType($source_type)
loadById(ilTermsOfServiceAcceptanceEntity $entity)
trackAcceptance(ilTermsOfServiceAcceptanceEntity $entity)
loadCurrentAcceptanceOfUser(ilTermsOfServiceAcceptanceEntity $entity)
deleteAcceptanceHistoryByUser(ilTermsOfServiceAcceptanceEntity $entity)
setIso2LanguageCode($language)