|
dolibarr 24.0.0-beta
|
Class DataPolicyCron. More...
Public Member Functions | |
| __construct (DoliDB $db) | |
| Constructor. | |
| getDataPolicies () | |
| Defines and returns the centralized data policy configuration. | |
| cleanDataForDataPolicy () | |
| Main cron task execution method. | |
Private Member Functions | |
| _handleDelete ($object, $user, $policy) | |
| Handles the specific logic for deleting an object. | |
| _handleAnonymize ($object, $user, $policy) | |
| Handles the specific logic for anonymizing an object. | |
| _anonymizeExtraFields ($object) | |
| Anonymizes extra fields flagged as personal data (personal_data = 1) for a given object. | |
| _buildCallArguments ($object, $user, $policy, $method) | |
| Builds the dynamic argument list for method calls based on policy configuration. | |
| _recordActionResult ($result, $object, $action) | |
| Records the result of an action, updating counters and error messages. | |
Class DataPolicyCron.
Definition at line 32 of file datapolicycron.class.php.
| DataPolicyCron::__construct | ( | DoliDB | $db | ) |
|
private |
Anonymizes extra fields flagged as personal data (personal_data = 1) for a given object.
Rules applied:
| CommonObject | $object | The object whose extra fields must be anonymized. |
Definition at line 463 of file datapolicycron.class.php.
References $object, and dol_mktime().
Referenced by _handleAnonymize().
|
private |
Builds the dynamic argument list for method calls based on policy configuration.
| CommonObject | $object | The target object. |
| User | $user | The user object. |
| array<string,mixed> | $policy The policy configuration. | |
| 'delete'|'update' | $method The method key ('delete' or 'update'). |
| string$paramName | Name of parameter to get |
Definition at line 522 of file datapolicycron.class.php.
References $object.
Referenced by _handleAnonymize(), and _handleDelete().
|
private |
Handles the specific logic for anonymizing an object.
| CommonObject | $object | The object to anonymize. |
| User | $user | The user performing the action. |
| array<string,mixed> | $policy The policy configuration. |
Definition at line 425 of file datapolicycron.class.php.
References $object, _anonymizeExtraFields(), and _buildCallArguments().
|
private |
Handles the specific logic for deleting an object.
| CommonObject | $object | The object to delete. |
| User | $user | The user performing the action. |
| array<string,mixed> | $policy The policy configuration. |
Definition at line 410 of file datapolicycron.class.php.
References $object, and _buildCallArguments().
|
private |
Records the result of an action, updating counters and error messages.
| int | $result | The result code from the action (<0 for error). |
| CommonObject | $object | The processed object. |
| string | $action | The action that was performed ('delete' or 'anonymize'). |
Definition at line 551 of file datapolicycron.class.php.
References $object.
| DataPolicyCron::cleanDataForDataPolicy | ( | ) |
Main cron task execution method.
Orchestrates the data cleaning process by iterating through all defined policies.
Definition at line 283 of file datapolicycron.class.php.
References $conf, $object, and getDataPolicies().
| DataPolicyCron::getDataPolicies | ( | ) |
Defines and returns the centralized data policy configuration.
Separating this makes the main method cleaner.
Definition at line 64 of file datapolicycron.class.php.
References Societe\CUSTOMER, Societe\CUSTOMER_AND_PROSPECT, dol_mktime(), img_picto(), isModEnabled(), Societe\NO_CUSTOMER, and Societe\PROSPECT.
Referenced by cleanDataForDataPolicy().