PHP code example of maillotf / ardaccess-bridge-bundle

1. Go to this page and download the library: Download maillotf/ardaccess-bridge-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

maillotf / ardaccess-bridge-bundle example snippets



//...
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));
	}

}