This is an old revision of the document!
Table of Contents
DataRequestService
Layer: Service · Source: lib/service/DataRequestService.php:30 (lines 30–390)
class DataRequestService
DataRequestService Class
Service layer for GDPR data requests (access, deletion)
Docblock Metadata
^ Tag ^ Value ^ | ''@category'' | Service Class | | ''@author'' | Scriptlog | | ''@license'' | MIT | | ''@version'' | 1.0 | | ''@since'' | Since Release 1.0 |
Inheritance
No parent, interface or trait. This is a root type.
Constants (0)
None.
Properties (0)
None declared.
Methods (13)
^ Visibility ^ Method ^ Summary ^ Line ^ | public | ''__construct()'' | Constructor | 92 | | public | ''createRequest()'' | Create a new data request | 112 | | public | ''getAllRequests()'' | Get all requests | 153 | | public | ''getPendingCount()'' | Get pending requests count | 163 | | public | ''getTotalRequests()'' | Get total requests count | 173 | | public | ''updateRequestStatus()'' | Update request status | 186 | | public | ''exportUserData()'' | Export user data | 221 | | public | ''deleteUserData()'' | Delete user data (anonymize) | 287 | | private | ''getUserService()'' | Lazy-access the injected UserService, falling back to a fresh instance | 326 | | private | ''getUserDao()'' | Lazy-access the injected UserDao, falling back to a fresh instance | 341 | | private | ''getCommentDao()'' | Lazy-access the injected CommentDao, falling back to a fresh instance | 356 | | private | ''getPostDao()'' | Lazy-access the injected PostDao, falling back to a fresh instance | 371 | | private | ''validateEmail()'' | Validate email address | 386 |
__construct()
public function __construct(DataRequestDao $dataRequestDao, PrivacyLogDao $privacyLogDao, Sanitize $sanitizer, ?ConfigurationService $configService = null, ?UserService $userService = null, ?UserDao $userDao = null, ?CommentDao $commentDao = null, ?PostDao $postDao = null)
lines 92–102 (11)
Constructor
^ Parameter ^ Type ^ Default ^ Description ^ | ''$dataRequestDao'' | [[scriptlog:lib:dao:datarequestdao|''DataRequestDao'']] | //required// | //none// | | ''$privacyLogDao'' | [[scriptlog:lib:dao:privacylogdao|''PrivacyLogDao'']] | //required// | //none// | | ''$sanitizer'' | [[scriptlog:lib:core:sanitize|''Sanitize'']] | //required// | //none// | | ''$configService'' | [[scriptlog:lib:service:configurationservice|''?ConfigurationService'']] | ''null'' | //none// | | ''$userService'' | [[scriptlog:lib:service:userservice|''?UserService'']] | ''null'' | //none// | | ''$userDao'' | [[scriptlog:lib:dao:userdao|''?UserDao'']] | ''null'' | //none// | | ''$commentDao'' | [[scriptlog:lib:dao:commentdao|''?CommentDao'']] | ''null'' | //none// | | ''$postDao'' | [[scriptlog:lib:dao:postdao|''?PostDao'']] | ''null'' | //none// |
createRequest()
public function createRequest($requestType, $email, $options = [])
lines 112–146 (35)
Create a new data request
^ Parameter ^ Type ^ Default ^ Description ^ | ''$requestType'' | ''(untyped)'' | //required// | //none// | | ''$email'' | ''(untyped)'' | //required// | //none// | | ''$options'' | ''(untyped)'' | ''[]'' | //none// |
Returns: (none declared) — int|bool
getAllRequests()
public function getAllRequests()
lines 153–156 (4)
Get all requests
Takes no parameters.
Returns: (none declared) — array
getPendingCount()
public function getPendingCount()
lines 163–166 (4)
Get pending requests count
Takes no parameters.
Returns: (none declared) — int
getTotalRequests()
public function getTotalRequests()
lines 173–176 (4)
Get total requests count
Takes no parameters.
Returns: (none declared) — int
updateRequestStatus()
public function updateRequestStatus($requestId, $status, $note = null)
lines 186–212 (27)
Update request status
^ Parameter ^ Type ^ Default ^ Description ^ | ''$requestId'' | ''(untyped)'' | //required// | //none// | | ''$status'' | ''(untyped)'' | //required// | //none// | | ''$note'' | ''(untyped)'' | ''null'' | //none// |
Returns: (none declared) — bool
exportUserData()
public function exportUserData($email, $options = [])
lines 221–275 (55)
Export user data
^ Parameter ^ Type ^ Default ^ Description ^ | ''$email'' | ''(untyped)'' | //required// | //none// | | ''$options'' | ''(untyped)'' | ''[]'' | //none// |
Returns: (none declared) — array
deleteUserData()
public function deleteUserData($email)
lines 287–318 (32)
Delete user data (anonymize)
Delegates to UserService::removeUserWithAnonymization() so the erasure machinery (comment anonymization, post reassignment, account removal) is actually executed instead of only logging.
^ Parameter ^ Type ^ Default ^ Description ^ | ''$email'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — bool
getUserService()
private function getUserService()
lines 326–333 (8)
Lazy-access the injected UserService, falling back to a fresh instance
when none was provided (backward compatibility with existing callers).
Takes no parameters.
Returns: (none declared) — UserService
getUserDao()
private function getUserDao()
lines 341–348 (8)
Lazy-access the injected UserDao, falling back to a fresh instance
when none was provided (backward compatibility with existing callers).
Takes no parameters.
Returns: (none declared) — UserDao
getCommentDao()
private function getCommentDao()
lines 356–363 (8)
Lazy-access the injected CommentDao, falling back to a fresh instance
when none was provided (backward compatibility with existing callers).
Takes no parameters.
Returns: (none declared) — CommentDao
getPostDao()
private function getPostDao()
lines 371–378 (8)
Lazy-access the injected PostDao, falling back to a fresh instance
when none was provided (backward compatibility with existing callers).
Takes no parameters.
Returns: (none declared) — PostDao
validateEmail()
private function validateEmail($email)
lines 386–389 (4)
Validate email address
^ Parameter ^ Type ^ Default ^ Description ^ | ''$email'' | ''(untyped)'' | //required// | //none// |
Returns: (none declared) — bool
Imports
^ Alias ^ Fully-qualified name ^ | ''AppException'' | [[scriptlog:lib:core:appexception|''Scriptlog\Core\AppException'']] | | ''FormValidator'' | [[scriptlog:lib:core:formvalidator|''Scriptlog\Core\FormValidator'']] | | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | | ''CommentDao'' | [[scriptlog:lib:dao:commentdao|''Scriptlog\Dao\CommentDao'']] | | ''DataRequestDao'' | [[scriptlog:lib:dao:datarequestdao|''Scriptlog\Dao\DataRequestDao'']] | | ''PostDao'' | [[scriptlog:lib:dao:postdao|''Scriptlog\Dao\PostDao'']] | | ''PrivacyLogDao'' | [[scriptlog:lib:dao:privacylogdao|''Scriptlog\Dao\PrivacyLogDao'']] | | ''UserDao'' | [[scriptlog:lib:dao:userdao|''Scriptlog\Dao\UserDao'']] | | ''UserTokenDao'' | [[scriptlog:lib:dao:usertokendao|''Scriptlog\Dao\UserTokenDao'']] |
This page is generated from source by 'tools/gendoc'. Edits will be overwritten.
