...
 
Commits (2)
......@@ -4,14 +4,53 @@ Documents Statuses Library
A library to update all statuses.
## how to install
## How to use
Add in your composer.json the following:
```
"repositories":[
{
"type": "vcs",
"url": "https://gitlab.aboutgoods.net/open-source/sf-bundle/sf3-translations.git"
"url": "https://gitlab.aboutgoods.net/open-source/document-statuses.git"
}
],
```
\ No newline at end of file
"require": {
"aboutgoods/document-statuses": "^0"
}
```
Then run `composer update`.
This project contains a generated class named `AG\DocumentStatuses\DocumentStatuses`
it contains constants for each statuses :
```php
const WAITING_FOR_PROCESS='WAITING_FOR_PROCESS';
const PROCESSING='PROCESSING';
const PROCESSED='PROCESSED';
const ERROR='ERROR';
const ERROR_NOT_RECEIPT='ERROR_NOT_RECEIPT';
```
and methods:
```php
public static function getRunningStatuses();
public static function getFinalStatuses();
public static function getErrorStatuses();
public static function getAll();
```
## Update this library
If you want to add new statuses, just edit the `data/statuses.yml`
```yaml
running:
- WAITING_FOR_PROCESS
- PROCESSING
final:
- PROCESSED
error:
- ERROR
- ERROR_NOT_RECEIPT
```
For compatibility purposes, you cannot remove
the already Existing Sections but you can add yours.
After that, just run `php generate` and then `php test`.
\ No newline at end of file