Skip to content

Instantly share code, notes, and snippets.

@asika32764
Last active December 14, 2015 12:48
Show Gist options
  • Select an option

  • Save asika32764/5088434 to your computer and use it in GitHub Desktop.

Select an option

Save asika32764/5088434 to your computer and use it in GitHub Desktop.
<?php
public function getSchools()
{
// Get City id for query School.
$id = $this->getState('city.id');
// 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