PHP code example of oh-deer-bundles / smart-export-bundle

1. Go to this page and download the library: Download oh-deer-bundles/smart-export-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/ */

    

oh-deer-bundles / smart-export-bundle example snippets


return [
    // ...
    Odb\SmartExportBundle\OdbSmartExportBundle::class => ['all' => true],
];

namespace App\Services\Security;

use App\Entity\Customer\Customer;
use Odb\SmartExportBundle\Services\AllowedIdsVoterInterface;

class SmartExportVoter implements AllowedIdsVoterInterface
{
    public function getAllowedIds(string $className): array
    {
        // $className is the FQCN, exactly as listed in restricted_entities below.
        // Return every id of that entity the CURRENT user may see; [] means none.
        return match ($className) {
            Customer::class => $this->accessManager->getAllowedCustomerIds(),
            default => [],
        };
    }
}