references:joomla.framework:application:jmodel-_getlist_getList
Returns an object list based on the specified query. This is a protected method that can be used to retrieve the model’s data. It provides handling for selecting a subset of the total records of the query. Syntaxarray &_getList ( $query, $limitstart, $limit )
ExamplesExample jimport( 'joomla.application.component.model' ); class PollModelPoll extends JModel { function __construct() { $config = array( 'table_path' => JPATH_COMPONENT.DS.'tables' ); parent::__construct( $config ); } function getData() { $query = 'SELECT * FROM #__polls'; return $this->_getList( $query ); } } $model =& JModel::getInstance( 'poll', 'PollModel' ); $data =& $model->getData(); print_r( $data ); might produce Result Array ( [0] => stdClass Object ( [id] => 14 [title] => Joomla! is used for? [alias] => joomla-is-used-for [voters] => 7 [checked_out] => 0 [checked_out_time] => 0000-00-00 00:00:00 [published] => 1 [access] => 0 [lag] => 86400 ) ) |


