translator->trans('true'); * case false: * return $this->translator->trans('false'); * default: * // this should not happens ! * throw new \LogicException(); * } * } * ``` * * **Note:** Why each string must be translated with an exception for * the `_header` ? For performance reasons: most of the value will be number * which do not need to be translated, or value already translated in * database. But the header must be, in every case, translated. * * @param string $key The column key, as added in the query * @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR') * * @return callable(mixed $value): (string|int|\DateTimeInterface|TranslatableInterface) where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }` */ public function getLabels(string $key, array $values, mixed $data): callable; /** * give the list of keys the current export added to the queryBuilder in * self::initiateQuery. * * Example: if your query builder will contains `SELECT count(id) AS count_id ...`, * this function will return `array('count_id')`. * * @param D $data the data from the export's form (added by self::buildForm) * * @return list */ public function getQueryKeys(array $data): array; }