/** * Get country accounts chart types. * * @return array * An array of arrays as follows: array(array('id' => $id, 'name' => $name, 'url' => $url),…) */ public function getCountryAccountsChartsTypes() { $accountsChartsTypes = array(); $this->AccountChartType->accountsChartsTypesByCountry($this->AuthenticationManager->getCurrentUserOrganizationCountry())->each(function ($AccountChartType) use(&$accountsChartsTypes) { $name = $this->Lang->has($AccountChartType->lang_key) ? $this->Lang->get($AccountChartType->lang_key) : $AccountChartType->name; array_push($accountsChartsTypes, array('id' => $AccountChartType->id, 'name' => $name, 'url' => $AccountChartType->url)); }); return $accountsChartsTypes; }