|
dolibarr 25.0.0-alpha
|


Public Member Functions | |
| __construct () | |
| Constructor. | |
| get ($id) | |
| Get properties of a website object by id. | |
| getByRef ($ref) | |
| Get properties of a website object by ref. | |
| index ($sortfield="t.rowid", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='', $properties='') | |
| List websites. | |
| indexPages ($id, $sortfield="t.pageurl", $sortorder='ASC', $limit=100, $page=0, $sqlfilters='', $properties='') | |
| List pages of a website. | |
| getPage ($id, $pageid) | |
| Get properties of a website page by id. | |
| putPage ($id, $pageid, $request_data=null) | |
| Update a website page. | |
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 | |
| _fetchWebsite ($id, $ref='') | |
| Get properties of a website object. | |
| _regeneratePageFiles ($website, $websitepage) | |
| Regenerate static page files on disk (master.inc.php, alias, tpl content). | |
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 37 of file api_websites.class.php.
|
protected |
Clean sensible object datas @phpstan-template T.
| Object | $object | Object to clean |
@phpstan-param T $object @phpstan-return T
Reimplemented from DolibarrApi.
Definition at line 438 of file api_websites.class.php.
References $object.
Referenced by _fetchWebsite(), getPage(), index(), indexPages(), and putPage().
|
private |
Get properties of a website object.
| int | $id | ID of website |
| string | $ref | Ref of website |
| RestException | 400 Bad value for parameter id or ref |
| RestException | 403 Access denied |
| RestException | 404 Website not found |
Definition at line 522 of file api_websites.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
Referenced by get(), and getByRef().
|
private |
Regenerate static page files on disk (master.inc.php, alias, tpl content).
This replicates the behavior of the web interface in htdocs/website/index.php when a page is updated (action = updatesource/updatecontent).
Definition at line 553 of file api_websites.class.php.
References $conf, dol_mkdir(), dol_syslog(), dolSaveMasterFile(), dolSavePageAlias(), and dolSavePageContent().
Referenced by putPage().
| Websites::get | ( | $id | ) |
Get properties of a website object by id.
Return an array with website information.
| int | $id | ID of website |
@url GET {id}
| RestException | 403 Access denied |
| RestException | 404 Website not found |
Definition at line 76 of file api_websites.class.php.
References $id, and _fetchWebsite().
| Websites::getByRef | ( | $ref | ) |
Get properties of a website object by ref.
Return an array with website information.
| string | $ref | Ref of website |
@url GET ref/{ref}
| RestException | 403 Access denied |
| RestException | 404 Website not found |
Definition at line 96 of file api_websites.class.php.
References _fetchWebsite().
| Websites::getPage | ( | $id, | |
| $pageid ) |
Get properties of a website page by id.
Return an array with page information.
| int | $id | ID of website |
| int | $pageid | ID of page |
@url GET {id}/pages/{pageid}
| RestException | 403 Access denied |
| RestException | 404 Website or page not found |
Definition at line 305 of file api_websites.class.php.
References $id, DolibarrApi\_checkAccessToResource(), and _cleanObjectDatas().
| Websites::index | ( | $sortfield = "t.rowid", | |
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $sqlfilters = '', | |||
| $properties = '' ) |
List websites.
Get a list of websites
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%')" |
| string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
| RestException | 400 Bad sqlfilters |
| RestException | 403 Access denied |
| RestException | 503 Error retrieving list of websites |
Definition at line 120 of file api_websites.class.php.
References _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), and forgeSQLFromUniversalSearchCriteria().
| Websites::indexPages | ( | $id, | |
| $sortfield = "t.pageurl", | |||
| $sortorder = 'ASC', | |||
| $limit = 100, | |||
| $page = 0, | |||
| $sqlfilters = '', | |||
| $properties = '' ) |
List pages of a website.
Get a list of pages for a given website
| int | $id | ID of website |
| string | $sortfield | Sort field |
| string | $sortorder | Sort order |
| int | $limit | Limit for list |
| int | $page | Page number |
| string | $sqlfilters | Other criteria to filter answers separated by a comma. Syntax example "(t.pageurl:like:'home')" |
| string | $properties | Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names |
@url GET {id}/pages
| RestException | 400 Bad sqlfilters |
| RestException | 403 Access denied |
| RestException | 404 Website not found |
| RestException | 503 Error retrieving list of pages |
Definition at line 212 of file api_websites.class.php.
References $id, DolibarrApi\_checkAccessToResource(), _cleanObjectDatas(), DolibarrApi\_filterObjectProperties(), and forgeSQLFromUniversalSearchCriteria().
| Websites::putPage | ( | $id, | |
| $pageid, | |||
| $request_data = null ) |
Update a website page.
Update a page of a website by its ID. The request data can include any field of the website_page table (title, description, content, pageurl, status, etc.).
| int | $id | ID of website |
| int | $pageid | ID of page to update |
| array | $request_data | Page data @phan-param ?array<string,string> $request_data @phpstan-param ?array<string,string> $request_data |
@url PUT {id}/pages/{pageid}
| RestException | 403 Access denied |
| RestException | 404 Website or page not found |
| RestException | 500 Error updating page |
Definition at line 354 of file api_websites.class.php.
References $id, DolibarrApi\_checkAccessToResource(), DolibarrApi\_checkValExtrafieldsForAPI(), DolibarrApi\_checkValForAPI(), _cleanObjectDatas(), _regeneratePageFiles(), dolKeepOnlyPhpCode(), and sanitizeVal().