query = $this->loadService(TaxRateRepositoryQuery::class); } public function getDefaultOptionsSearch(): array { return [ 'with' => [], 'join_with' => [], 'orderby' => 'pourcent ASC', 'attribute_id_producer' => '' ] ; } public function findOneTaxRateById(int $id): ?TaxRate { return TaxRate::searchOne(['id' => $id]); } public function findTaxRates(): array { return TaxRate::find()->all(); } // getTaxRateArray public function findTaxRatesAsArray(): array { $taxRateArrayReturn = []; $taxRateArray = $this->findTaxRates(); foreach($taxRateArray as $taxRate) { $taxRateArrayReturn[$taxRate->id] = $taxRate; } return $taxRateArrayReturn; } }