|
dolibarr 25.0.0-alpha
|


Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id) | |
| Get properties of a cron job object. | |
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $status=-1, $sqlfilters='', $properties='', $pagination_data=false) | |
| List cron jobs. | |
| post ($request_data=null) | |
| Create cron job object. | |
| put ($id, $request_data=null) | |
| Update cron job fields. | |
| delete ($id) | |
| Delete cron job. | |
| run ($id, $securitykey='') | |
| Run a cron job now. | |
Public Member Functions inherited from DolibarrApi | |
| __construct ($db, $cachedir='', $refreshCache=false) | |
| Constructor. | |
Protected Member Functions | |
| _cleanObjectDatas ($object) | |
| Clean sensible object datas @phpstan-template T. | |
Protected Member Functions inherited from DolibarrApi | |
| _checkValForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _checkValExtrafieldsForAPI ($field, $value, $object) | |
| Check and convert a string depending on its type/name. | |
| _filterObjectProperties ($object, $properties) | |
| Filter properties that will be returned on object. | |
| _checkFilters ($sqlfilters, &$error='') | |
| Return if a $sqlfilters parameter is valid Function no more used. | |
Private Member Functions | |
| _validate ($data) | |
| Validate fields before create or update object. | |
Additional Inherited Members | |
Static Protected Member Functions inherited from DolibarrApi | |
| static | _checkAccessToResource ($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $parenttableforentity='') |
| Check access by user to a given resource. | |
| static | _forge_criteria_callback ($matches) |
| Function to forge a SQL criteria from a Generic filter string. | |
Definition at line 28 of file api_cronjobs.class.php.
|
protected |
Clean sensible object datas @phpstan-template T.
| Object | $object | Object to clean |
Reimplemented from DolibarrApi.
Definition at line 305 of file api_cronjobs.class.php.
References $object.
|
private |
Validate fields before create or update object.
| ?array<string,string> | $data Array with data to verify |
| RestException |
Definition at line 322 of file api_cronjobs.class.php.
Referenced by post().
| Cronjobs::delete | ( | $id | ) |
Delete cron job.
| int | $id | Cron job ID |
| RestException |
Definition at line 217 of file api_cronjobs.class.php.
References $id, and DolibarrApi\_checkAccessToResource().
| Cronjobs::get | ( | $id | ) |
Get properties of a cron job object.
Return an array with cron job information
| int | $id | ID of cron job |
| RestException |
Definition at line 63 of file api_cronjobs.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Cronjobs::index | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $status = -1, | |||
| $sqlfilters = '', | |||
| $properties = '', | |||
| $pagination_data = false ) |
List cron jobs.
Get a list of cron jobs
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| int | $status | Filter on status (-1=no filter, 0=disabled, 1=enabled, 2=archived) |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%foo%')" |
| string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
| bool | $pagination_data | If this parameter is set to true the response will include pagination data. Default value is false. Page starts from 0 |
| RestException |
Definition at line 100 of file api_cronjobs.class.php.
References _cleanObjectDatas(), and DolibarrApi\_filterObjectProperties().
| Cronjobs::post | ( | $request_data = null | ) |
Create cron job object.
| array | $request_data | Request data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException |
Definition at line 148 of file api_cronjobs.class.php.
References DolibarrApi\_checkValForAPI(), and _validate().
| Cronjobs::put | ( | $id, | |
| $request_data = null ) |
Update cron job fields.
| int | $id | Id of cron job to update |
| array | $request_data | Data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
| RestException |
Definition at line 178 of file api_cronjobs.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and DolibarrApi\_checkValForAPI().
| Cronjobs::run | ( | $id, | |
| $securitykey = '' ) |
Run a cron job now.
Runs the job synchronously, in the current API request (there is no asynchronous job queue: this call blocks until the job finishes, exactly like the "Execute" button on the cron job card). The job's own success/failure is reported in the returned object (lastresult / lastoutput / datelastresult), it does not by itself make this call fail.
| int | $id | Cron job ID |
| string | $securitykey | Security key, mandatory only if the CRON_KEY global constant is set {@from query} |
@url POST {id}/run
| RestException |
Definition at line 261 of file api_cronjobs.class.php.
References $id, DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), dol_now(), and getDolGlobalString().