PHP code example of steph612 / entreprise-search-bundle

1. Go to this page and download the library: Download steph612/entreprise-search-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/ */

    

steph612 / entreprise-search-bundle example snippets


use Steph612\EntrepriseSearchBundle\Client\EntrepriseSearchClientInterface;

public function __construct(
    private EntrepriseSearchClientInterface $entrepriseClient
) {
}

public function search(): Response
{
    $result = $this->entrepriseClient->search('carrefour');
    foreach ($result->results as $entreprise) {
        echo $entreprise->nomComplet . ' - ' . $entreprise->siren;
    }
}

$entreprise = $this->entrepriseClient->findBySiren('652014051');if ($entreprise) {
    echo $entreprise->nomComplet;
}
bash
# Recherche simple
php bin/console steph612:search-entreprise carrefour

# Par SIREN (détails complets)
php bin/console steph612:search-entreprise 652014051 --siren