| Current Path : /var/www/iplanru/data/www/i-plan.ru/components/com_poll/models/ |
| Current File : /var/www/iplanru/data/www/i-plan.ru/components/com_poll/models/poll.php |
<?php
// No direct access
defined( '_JEXEC' ) or die;
/**
* Model to see the current entries
* @author kirdinyuri
*/
class PollModelPoll extends JModelList
{
/**
* @var JRegistry
*/
private $params;
/**
* @var JInput|null
*/
private $input;
/**
* Class constructor
* @param Array $config
*/
public function __construct( $config = array() )
{
parent::__construct( $config );
$this->params = JComponentHelper::getParams( 'com_poll' );
$this->input = JFactory::getApplication()->input;
}
/**
* Method for receiving a request to view records
* @return Object Query
*/
protected function getListQuery()
{
$this->setState( 'list.start', $this->input->get( 'start' ) );
$this->setState( 'list.limit', $this->params->get( 'limit', 10 ) );
$query = $this->getDbo()->getQuery( true );
$query->select( '*' )->from( '#__pollquestions' )->where( 'published=1' );
return $query;
}
}