|
dolibarr 23.0.3
|
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. | |
| _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 31 of file datapolicycron.class.php.
| DataPolicyCron::__construct | ( | DoliDB | $db | ) |
Constructor.
Definition at line 52 of file datapolicycron.class.php.
|
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 453 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 424 of file datapolicycron.class.php.
References $object, 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 409 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 482 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 282 of file datapolicycron.class.php.
References $object, and getDataPolicies().
| DataPolicyCron::getDataPolicies | ( | ) |
Defines and returns the centralized data policy configuration.
Separating this makes the main method cleaner.
Definition at line 63 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().