Commit a5459e7b authored by François Agneray's avatar François Agneray
Browse files

Fixes typing problems

parent a28a05ef
Pipeline #5112 passed with stages
in 2 minutes and 9 seconds
......@@ -48,7 +48,10 @@ final class AttributeListAction extends AbstractAction
}
if ($request->getMethod() === GET) {
$attributes = $this->em->getRepository('App\Entity\Attribute')->findByDataset($dataset);
$attributes = $this->em->getRepository('App\Entity\Attribute')->findBy(
array('dataset' => $dataset),
array('id' => 'ASC')
);
$payload = json_encode($attributes);
}
......
......@@ -52,7 +52,10 @@ final class CriteriaFamilyListAction extends AbstractAction
}
if ($request->getMethod() === GET) {
$families = $this->em->getRepository('App\Entity\CriteriaFamily')->findByDataset($dataset);
$families = $this->em->getRepository('App\Entity\CriteriaFamily')->findBy(
array('dataset' => $dataset),
array('id' => 'ASC')
);
$payload = json_encode($families);
}
......
......@@ -41,7 +41,10 @@ final class DatabaseListAction extends AbstractAction
if ($request->getMethod() === GET) {
// Retrieve user with email adress
$databases = $this->em->getRepository('App\Entity\Database')->findAll();
$databases = $this->em->getRepository('App\Entity\Database')->findBy(
array(),
array('id' => 'ASC')
);
$payload = json_encode($databases);
}
......
......@@ -52,7 +52,7 @@ final class DatasetFamilyListAction extends AbstractAction
}
if ($request->getMethod() === GET) {
$families = $this->em->getRepository('App\Entity\DatasetFamily')->findByInstance($instance);
$families = $this->em->getRepository('App\Entity\DatasetFamily')->findBy(array('instance' => $instance));
$payload = json_encode($families);
}
......
......@@ -73,7 +73,9 @@ final class DatasetListAction extends AbstractAction
}
if ($request->getMethod() === GET) {
$datasets = $this->em->getRepository('App\Entity\Dataset')->findByDatasetFamily($datasetFamily);
$datasets = $this->em->getRepository('App\Entity\Dataset')->findBy(
array('datasetFamily' => $datasetFamily)
);
$payload = json_encode($datasets);
}
......
......@@ -53,7 +53,10 @@ final class GroupListAction extends AbstractAction
if ($request->getMethod() === GET) {
// Retrieve group with id
$groups = $this->em->getRepository('App\Entity\Group')->findByInstance($instance);
$groups = $this->em->getRepository('App\Entity\Group')->findBy(
array('instance' => $instance),
array('id' => 'ASC')
);
$payload = json_encode($groups);
}
......
......@@ -52,8 +52,9 @@ final class OutputCategoryListAction extends AbstractAction
}
if ($request->getMethod() === GET) {
$outputCategories = $this->em->getRepository('App\Entity\OutputCategory')->findByOutputFamily(
$outputFamily
$outputCategories = $this->em->getRepository('App\Entity\OutputCategory')->findBy(
array('outputFamily' => $outputFamily),
array('id' => 'ASC')
);
$payload = json_encode($outputCategories);
}
......
......@@ -52,7 +52,10 @@ final class OutputFamilyListAction extends AbstractAction
}
if ($request->getMethod() === GET) {
$families = $this->em->getRepository('App\Entity\OutputFamily')->findByDataset($dataset);
$families = $this->em->getRepository('App\Entity\OutputFamily')->findBy(
array('dataset' => $dataset),
array('id' => 'ASC')
);
$payload = json_encode($families);
}
......
......@@ -110,7 +110,7 @@ class Instance implements \JsonSerializable
{
$nbDatasets = 0;
foreach ($this->datasetFamilies as $family) {
$nbDatasets += $family->getDatasets()->count();
$nbDatasets += count($family->getDatasets());
}
return $nbDatasets;
}
......@@ -122,7 +122,7 @@ class Instance implements \JsonSerializable
'label' => $this->getLabel(),
'client_url' => $this->getClientUrl(),
'config' => $this->getConfig(),
'nb_dataset_families' => $this->getDatasetFamilies()->count(),
'nb_dataset_families' => count($this->getDatasetFamilies()),
'nb_datasets' => $this->getNbDatasets()
];
}
......
......@@ -125,16 +125,4 @@ class AnisQueryBuilder
$queryPart($this, $this->datasetSelected, $queryParams);
}
}
/**
* Executes this query using the bound parameters and their types.
*
* @return ResultStatement|int
*
* @throws Exception
*/
public function execute(): ResultStatement | int
{
return $this->doctrineQueryBuilder->execute();
}
}
......@@ -32,7 +32,7 @@ class JsonResponse implements IResponse
*/
public function getResponse(Response $response, AnisQueryBuilder $anisQueryBuilder): Response
{
$stmt = $anisQueryBuilder->execute();
$stmt = $anisQueryBuilder->getDoctrineQueryBuilder()->execute();
$attributes = $anisQueryBuilder->getAttributesSelected();
$payload = json_encode($this->decodeNestedJson($stmt, $attributes), JSON_UNESCAPED_SLASHES);
$response->getBody()->write($payload);
......
......@@ -52,7 +52,7 @@ class TextResponse implements IResponse
*/
public function getResponse(Response $response, AnisQueryBuilder $anisQueryBuilder): Response
{
$stmt = $anisQueryBuilder->execute();
$stmt = $anisQueryBuilder->getDoctrineQueryBuilder()->execute();
$attributes = $anisQueryBuilder->getAttributesSelected();
$payload = $this->transformArrayToCsv($stmt, $attributes);
$response->getBody()->write($payload);
......
......@@ -33,7 +33,7 @@ class VotableResponse implements IResponse
*/
public function getResponse(Response $response, AnisQueryBuilder $anisQueryBuilder): Response
{
$stmt = $anisQueryBuilder->execute();
$stmt = $anisQueryBuilder->getDoctrineQueryBuilder()->execute();
$dataset = $anisQueryBuilder->getDatasetSelected();
$attributes = $anisQueryBuilder->getAttributesSelected();
$payload = $this->getVoHeader($dataset, $attributes, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment