Skip to content

Commit

Permalink
Correction responseFields
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Granger committed Feb 16, 2021
1 parent ae3e965 commit a5f214b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/ApidaeMembres.php
Expand Up @@ -61,8 +61,8 @@ public function getMembres(array $filter,array $responseFields=null)
'apiKey'=>$this->projet_consultation_apiKey,
'filter'=>$filter
) ;
if ( isset($responseFields) && $responseFields != null && is_array($responseFields) )
$query['responseFields'] = $responseFields ;
if ( isset($responseFields) && $responseFields != null )
$query['responseFields'] = is_array($responseFields) ? json_encode($responseFields) : $responseFields ;

return $this->apidaeCurlMU('membre/get-membres',$query) ;
}
Expand All @@ -75,11 +75,10 @@ public function getMembres(array $filter,array $responseFields=null)
*/
public function getFilleuls(int $idParrain,array $types=null)
{

$filter = Array('idParrain'=>$idParrain) ;
if ( $types == null || ! is_array($types) ) $types = Array('Contributeur Généraliste') ;
if ( is_array($types) && sizeof($types) > 0 ) $filter['types'] = $types ;
$responseFields = Array("UTILISATEURS") ;
$responseFields = json_encode(Array("UTILISATEURS")) ;
return $this->getMembres($filter,$responseFields) ;
}
/**
Expand Down Expand Up @@ -157,9 +156,7 @@ public function getMembreById(int $id_membre,array $responseFields=null)
'apiKey'=>$this->projet_consultation_apiKey
) ;
if ( isset($responseFields) && $responseFields != null )
{
$query['responseFields'] = is_array($responseFields) ? json_encode($responseFields) : $responseFields ;
}

return $this->apidaeCurlMU('membre/get-by-id',$query,$id_membre) ;
}
Expand Down

0 comments on commit a5f214b

Please sign in to comment.