maillotf / ardaccess-bridge-bundle
An ARD Access bundle for Symfony
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.0
- symfony/config: ^3.2|^4.0|^4.1|^5.1
- symfony/dependency-injection: ^3.2|^4.0|^4.1|^5.1
- symfony/http-kernel: ^3.2|^4.0|^4.1|^5.1
Requires (Dev)
- phpunit/phpunit: ^6.5
This package is auto-updated.
Last update: 2024-11-14 22:10:50 UTC
README
Symfony bundle for ARD Access REST client which is base on username,password authentication
Documentation
Required configuration
Modify framework.yaml
ardaccess: authentication: protocol: "http" host: "127.0.0.1" port: "80" username: "USERNAME" password: "PASSWORD"
Modify services.yaml
services: MaillotF\Ardaccess\ArdaccessBridgeBundle\Service\ArdaccessService: '@ardaccess.service'
Package instalation with composer
$ composer require maillotf/ardaccess-bridge-bundle
Use in controller:
<?php //... use MaillotF\Ardaccess\ArdaccessBridgeBundle\Service\ArdaccessService; class exampleController extends AbstractController { /** * Example * * @Route("example", name="example", methods={"GET"}) * */ public function test(ArdaccessService $aas) { //List of the carriers $carriersList = $aas->carrier->ListCarriers(); //Update a carrier $apiAttributes = $aas->creator ->addAttribute('uid', 6078) ->addAttribute('rid', 794) ->addAttribute('firstname', 'Jean') ->addAttribute('lastname', 'Dupont') ->addAttribute('usergroup', '171,233') ->addAttribute('begindate', 946681200) ->addAttribute('enddate', 1627602000) ->addAttribute('country', 'France') ->getAttributes(); $attributes = $aas->carrier->Carrier(null, 'u', $apiAttributes); //Search with criterion $criterions = $aas->creator ->newCriterion('date', '>', 946681200) ->addSubCriterion('example', '=', 'value') ->addCriterion() ->newCriterion('...', '=', '...') ->addCriterion() ->getCriterionsArray() ; $result = $aas->supervision->ListEvents(null, $criterions); //Handback a smartobject $smartobjectId = 2; $success = $aas->getSmartObjectHelper()->handbackSmartObject($smartObjectId); if ($success === true) return ($this->json('OK')); return ($this->json('Not Found', Response::HTTP_BAD_REQUEST)); } }