|
@@ -1,4 +1,4 @@
|
|
|
-# ValidatorsBundle
|
|
|
+# DeviceBundle
|
|
|
|
|
|
- [Installation](#installation)
|
|
|
- [Validator](#validators)
|
|
@@ -11,14 +11,14 @@
|
|
|
"repositories": [
|
|
|
{
|
|
|
"type": "vcs",
|
|
|
- "url": "ssh://git@infra.flowdat.com:222/VendorSoftwareFlowdat3/ValidatorsBundle.git",
|
|
|
+ "url": "ssh://git@infra.flowdat.com:222/VendorSoftwareFlowdat3/DeviceBundle.git",
|
|
|
"options": {
|
|
|
"local_pk": "./keys/bitbucket.id_rsa"
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
"require": {
|
|
|
- "ik/validators-bundle": "dev-master"
|
|
|
+ "ik/device-bundle": "dev-master"
|
|
|
},
|
|
|
```
|
|
|
|
|
@@ -28,7 +28,7 @@
|
|
|
public function registerBundles()
|
|
|
{
|
|
|
$bundles = [
|
|
|
- new ValidatorsBundle\ValidatorsBundle(),
|
|
|
+ new DeviceBundle\DeviceBundle(),
|
|
|
];
|
|
|
.
|
|
|
.
|
|
@@ -39,35 +39,35 @@ public function registerBundles()
|
|
|
|
|
|
```yml
|
|
|
imports:
|
|
|
- - { resource: "bundles/ik/validators-bundle/parameters.yml" }
|
|
|
- - { resource: "@ValidatorsBundle/Resources/config/services.yml" }
|
|
|
+ - { resource: "bundles/ik/device-bundle/parameters.yml" }
|
|
|
+ - { resource: "@DeviceBundle/Resources/config/services.yml" }
|
|
|
```
|
|
|
|
|
|
-**app/config/bundles/ik/validators-bundle/parameters.yml**
|
|
|
+**app/config/bundles/ik/device-bundle/parameters.yml**
|
|
|
|
|
|
```yml
|
|
|
parameters:
|
|
|
device_check_url: 'http://127.0.0.1/base/app_dev.php/api/devices/check.json'
|
|
|
+ device_post_url: 'http://127.0.0.1/base/app_dev.php/api/devices.json'
|
|
|
+ device_delete_post_url: 'http://127.0.0.1/base/app_dev.php/api/device.json'
|
|
|
```
|
|
|
|
|
|
## Validators
|
|
|
|
|
|
|
|
|
-- **ValidatorsBundle\Validator\DeviceValidator**: Validator que chequea si se puede agregar un dispositivo dependiendo de la licencia actual. Para agregarlo por ej en la entidad OLT:
|
|
|
+- **DeviceBundle\Validator\DeviceValidator**: Validator que chequea si se puede agregar un dispositivo dependiendo de la licencia actual. Para agregarlo por ej en la entidad OLT:
|
|
|
|
|
|
```php
|
|
|
|
|
|
-use ValidatorsBundle\Validator as Validator;
|
|
|
-
|
|
|
-...
|
|
|
+use DeviceBundle\Validator\Constraints as ValidatorAssert;
|
|
|
+use DeviceBundle\Interfaces\DeviceInterface;
|
|
|
|
|
|
/**
|
|
|
* @ORM\Entity
|
|
|
* @UniqueEntity("ip")
|
|
|
*
|
|
|
- * @Validator\DeviceValidator
|
|
|
+ * @ValidatorAssert\Device
|
|
|
*/
|
|
|
-class OLT
|
|
|
-{
|
|
|
+class OLT implements DeviceInterface
|
|
|
|
|
|
```
|