.service
Table of contents
Files with the service extension are used for service purposes - to describe addresses in the system, api, database tables, and more. Almost every entity should have such files. An example of the exemplary contents of the entity.service file (where entity is the name of the entity):
namespace modules\entity;
class Service {
public $routes = [
// Your routes are here
];
public $api = [
// Your api methods here
];
public $schema = [
// Your database schema is here
];
function get_routes() {
return $this->routes;
}
function get_api() {
return $this->api;
}
function get_schema() {
return $this->schema;
}
install() {
// Actions during install
}
function uninstall() {
// Actions during uninstall
}
enable() {
// Actions during enable
}
disable() {
// Actions during disable
}
}
Latest articles
- 09.11.23IT / Database Errors when migrating from MySQL 5.6 to 5.7 and how to fix them - database dump import failed with an error or INSERT does not work. Disabling STRICT_TRANS_TABLES strict mode or using IGNORE
- 09.07.22IT / Misc Convert office files DOC, DOCX, DOCM, RTF to DOCX, DOCM, DOC, RTF, PDF, HTML, XML, TXT formats without loss and markup changes
- 07.07.22IT / Safety How to protect PHP, JS, HTML, CSS source code - obfuscation, minification, compression and encryption
- 06.07.22IT / Safety Connection not secure, problem with Lets Encrypt - how to fix expired 09/30/2021 DST Root CA X3, remove it manually and install ISRG Root X1. Example on MS Windows 7
- 08.07.21IT / Misc How to make a free translation for a website without an API, translate documents in Google Translate