Skip to content

Commit fe8116e

Browse files
committed
feat: Adds establishment usual name search
Improves search functionality by adding support for searching by the establishment's usual name. This change introduces the 'cue' (denominationUsuelleEtablissement) field to the search parameters. It also modifies the query construction logic to properly handle the 'cue' field by wrapping it within a 'periode' clause.
1 parent b93c58f commit fe8116e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Sirene.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public function searchEtablissement(
126126
"city" => "libelleCommuneEtablissement",
127127
"cp" => "codePostalEtablissement",
128128
"cc" => "codeCommuneEtablissement",
129+
"cue" => "denominationUsuelleEtablissement",
129130
"company" => "denominationUniteLegale",
130131
"sigle" => "sigleUniteLegale",
131132
"ape" => "activitePrincipaleUniteLegale",
@@ -139,6 +140,8 @@ public function searchEtablissement(
139140
if (array_key_exists($k, $list)) {
140141
if ($k === 'company' || $k === 'city') {
141142
$data .= $list[$k].":\"".rawurlencode($v)."\" AND ";
143+
} else if ($k === 'cue') {
144+
$data = "periode(".$data.$list[$k].":\"".rawurlencode($v).")\" AND ";
142145
} else {
143146
$data .= $list[$k].":".rawurlencode($v)." AND ";
144147
}

0 commit comments

Comments
 (0)