Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (23) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2020-09-11 (6 days ago) | Not yet rated by the users | Total: 43 This week: 43 | All time: 9,916 This week: 5 |
Version | License | PHP version | Categories | |||
mezon-crud-service 1.0.0 | MIT/X Consortium ... | 5 | PHP 5, Databases, Web services, Desig... |
Description | Author | |
This package can generate Web service that performs CRUD operations. |
Just print in console
composer require mezon/crud-service
And that's all )
Now we are ready to create out first CRUD service. Here it is:
/
* Service class
*/
class TodoService extends \Mezon\CrudService\CrudService
{
/
* Constructor
*/
public function __construct()
{
parent::__construct([
'fields' => [
'id' => [
'type' => 'integer'
],
'title' => [
'type' => 'string'
]
],
'table-name' => 'records',
'entity-name' => 'record'
]);
}
}
$service = new TodoService();
$service->run();
The main part of this listing is:
parent::__construct([
'fields' => [
'id' => [
'type' => 'integer'
],
'title' => [
'type' => 'string'
]
],
'table-name' => 'records',
'entity-name' => 'record'
]);
Here we describe a list of fields of our entity, table name where it is stored and entity name.
Out of the box a list of CRUD endpoints are available:
GET /list/
GET /all/
GET /exact/list/[il:ids]/
GET /exact/[i:id]/
GET /fields/
POST|PUT /delete/[i:id]/
POST|DELETE /delete/
POST|PUT /create/
POST /update/[i:id]/
GET /new/from/[s:date]/
GET /records/count/
GET /last/[i:count]/
GET /records/count/[s:field]
Files |
File | Role | Description | ||
---|---|---|---|---|
res (1 directory) | ||||
Tests (6 files, 1 directory) | ||||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
CrudService.php | Class | Class source | ||
CrudServiceLogic.php | Class | Class source | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files | / | Tests |
File | Role | Description | ||
---|---|---|---|---|
conf (9 files) | ||||
CrudServiceLogicTestsTrait.php | Class | Class source | ||
CrudServiceLogicUnitTest.php | Class | Class source | ||
CrudServiceLogicUnitTests.php | Class | Class source | ||
CrudServiceTests.php | Class | Class source | ||
CrudServiceUnitTest.php | Class | Class source | ||
CrudServiceUnitTests.php | Class | Class source |
Files | / | Tests | / | conf |
File | Role | Description |
---|---|---|
CrudServiceUnitTestsSetup.json | Data | Auxiliary data |
fields.json | Data | Auxiliary data |
GetDomainIdCrossDomainDisabled.json | Data | Auxiliary data |
GetSimpleRecords.json | Data | Auxiliary data |
InsertBasicFields.json | Data | Auxiliary data |
NoCreationDate.json | Data | Auxiliary data |
Setup.json | Data | Auxiliary data |
SetupCrudServiceNoFieldsUnitTests.json | Data | Auxiliary data |
SetupCrudServiceUnitTests.json | Data | Auxiliary data |
mezon-crud-service-2020-09-11.zip 23KB | |
mezon-crud-service-2020-09-11.tar.gz 18KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.