File manager - Edit - /home/verseaumee/ptitsanes/plugins/solidres/feedback/administrator/components/com_solidres/models/feedbacktypes.php
Back
<?php /* ------------------------------------------------------------------------ Solidres - Hotel booking extension for Joomla ------------------------------------------------------------------------ @Author Solidres Team @Website http://www.solidres.com @Copyright Copyright (C) 2013 - 2016 Solidres. All Rights Reserved. @License GNU General Public License version 3, or later ------------------------------------------------------------------------ */ defined('_JEXEC') or die; /** * Feedback Type model * * @package Solidres * @subpackage Feedback * @since 0.8.0 */ class SolidresModelFeedBackTypes extends JModelList { /** * Constructor. * * @param array An optional associative array of configuration settings. * * @see JController * @since 1.6 */ public function __construct($config = array()) { if (empty($config['filter_fields'])) { $config['filter_fields'] = array( 'id', 'r.id', 'name', 'r.name', 'scope', 'r.scope', ); } parent::__construct($config); } protected function populateState($ordering = null, $direction = null) { $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); $this->setState('filter.search', $search); $scope = $this->getUserStateFromRequest($this->context . '.filter.scope', 'filter_scope', ''); $this->setState('filter.scope', $scope); parent::populateState('r.id', 'desc'); } protected function getStoreId($id = '') { $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.scope'); return parent::getStoreId($id); } /** * Build an SQL query to load the list data. * * @return JDatabaseQuery * @since 1.6 */ protected function getListQuery() { // Create a new query object. $db = $this->getDbo(); $query = $db->getQuery(true); // Select the required fields from the table. $query->select( $this->getState( 'list.select', 'r.id, r.name, r.scope' ) ); $query->from($db->quoteName('#__sr_feedback_attributes', 'r')); $search = $this->getState('filter.search'); if (!empty($search)) { if (stripos($search, 'id:') === 0) { $query->where('r.id = ' . (int) substr($search, 3)); } else { $search = $db->quote('%' . str_replace(' ', '%', $db->escape(trim($search), true) . '%')); $query->where('r.name LIKE ' . $search); } } $scope = $this->getState('filter.scope', ''); if (is_numeric($scope)) { $query->where('r.scope = ' . (int) $scope); } $orderCol = $this->state->get('list.ordering', 'r.id'); $orderDirn = $this->state->get('list.direction', 'desc'); $query->order($db->escape($orderCol . ' ' . $orderDirn)); return $query; } }
| ver. 1.4 |
Github
|
.
| PHP 8.5.7 | Generation time: 0 |
proxy
|
phpinfo
|
Settings