Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public function getSchools()
// Get City id for query School.
$id = $this->getState('');
// Get Admin Model
JModelLegacy::addIncludePath( JPATH_COMPONENT_ADMINISTRATOR . '/models' );
$model = JModel::getInstance('Schools', 'TourModel', array('ignore_request' => true)) ;
// Set Filter, then getListQuery will auto insert into query.
$model->setState('filter', array('a.city_id' => $city_id));
// getItems
$schools = $model->getItems();
return $schools ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.