Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 73 | All time: 10,228 This week: 74 |
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 (23) |
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 (23) | / | 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 (23) | / | 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 |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
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.