@@ -149,8 +149,8 @@ private function _storeConsent(ServiceProvider $serviceProvider, $consentType)
149149 return false ;
150150 }
151151
152- $ query = "INSERT INTO consent (hashed_user_id, service_id, attribute, consent_type, consent_date)
153- VALUES (?, ?, ?, ?, NOW())
152+ $ query = "INSERT INTO consent (hashed_user_id, service_id, attribute, consent_type, consent_date, deleted_at )
153+ VALUES (?, ?, ?, ?, NOW(), '0000-00-00 00:00:00' )
154154 ON DUPLICATE KEY UPDATE attribute=VALUES(attribute), consent_type=VALUES(consent_type), consent_date=NOW() " ;
155155 $ parameters = array (
156156 sha1 ($ this ->_getConsentUid ()),
@@ -174,7 +174,6 @@ private function _storeConsent(ServiceProvider $serviceProvider, $consentType)
174174 EngineBlock_Exception::CODE_CRITICAL
175175 );
176176 }
177-
178177 return true ;
179178 }
180179
@@ -188,7 +187,15 @@ private function _hasStoredConsent(ServiceProvider $serviceProvider, $consentTyp
188187
189188 $ attributesHash = $ this ->_getAttributesHash ($ this ->_responseAttributes );
190189
191- $ query = "SELECT * FROM {$ this ->_tableName } WHERE hashed_user_id = ? AND service_id = ? AND attribute = ? AND consent_type = ? " ;
190+ $ query = "
191+ SELECT *
192+ FROM {$ this ->_tableName }
193+ WHERE hashed_user_id = ?
194+ AND service_id = ?
195+ AND attribute = ?
196+ AND consent_type = ?
197+ AND deleted_at IS NULL
198+ " ;
192199 $ hashedUserId = sha1 ($ this ->_getConsentUid ());
193200 $ parameters = array (
194201 $ hashedUserId ,
0 commit comments