references:joomla.framework:application:jmodel-_getlistcountTable of Contents
_getListCount
Returns a record count for the specified query. This method returns an integer specifying the number of records that executing the query returns. This method is protected and should only be invoked by JModel child classes. Syntaxint _getListCount ( $query )
ExamplesExample jimport( 'joomla.application.component.model' ); class PollModelPoll extends JModel { function __construct() { $config = array( 'table_path' => JPATH_COMPONENT.DS.'tables' ); parent::__construct( $config ); } function getDataCount() { $query = 'SELECT * FROM #__polls'; return $this->_getListCount( $query ); } } $model =& JModel::getInstance( 'poll', 'PollModel' ); $data =& $model->getDataCount(); print_r( $data ); might produce Result 1
|


