# DeviceBundle - [Installation](#installation) - [Validator](#validators) ## Installation **composer.json**: ```javascript "repositories": [ { "type": "vcs", "url": "ssh://git@infra.flowdat.com:222/VendorSoftwareFlowdat3/DeviceBundle.git", "options": { "local_pk": "./keys/bitbucket.id_rsa" } } ], "require": { "ik/device-bundle": "dev-master" }, ``` **app/AppKernel.php**: ```php public function registerBundles() { $bundles = [ new DeviceBundle\DeviceBundle(), ]; . . } ``` **app/config/config.yml**: ```yml imports: - { resource: "bundles/ik/device-bundle/parameters.yml" } - { resource: "@DeviceBundle/Resources/config/services.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 - **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 DeviceBundle\Validator\Constraints as ValidatorAssert; use DeviceBundle\Interfaces\DeviceInterface; /** * @ORM\Entity * @UniqueEntity("ip") * * @ValidatorAssert\Device */ class OLT implements DeviceInterface ```