public function getCentres($_id = '') { // Used by Ajax to return Centre list after selecting the Account if (isset($this->_data['ajax'])) { if (!empty($this->_data['id'])) { $_id = $this->_data['id']; } } $account = new GLAccount(); $account->load($_id); $centres = $account->getCentres(); if (empty($centres)) { $centres = array('' => 'None'); } if (isset($this->_data['ajax'])) { $this->view->set('options', $centres); $this->setTemplateName('select_options'); } else { return $centres; } }