Example #1
0
 /**
  * Constructor
  *
  * @param   array  $config  Configuration array
  */
 public function __construct($config = array())
 {
     if (empty($config['filter_fields'])) {
         $config['filter_fields'] = array('id', 's.id', 'name', 's.name', 'published', 's.published', 'ordering', 's.ordering', 'created_date', 's.created_date', 'modified_date', 's.modified_date', 'created_by', 's.created_by', 'modified_by', 's.modified_by');
     }
     parent::__construct($config);
 }
 /**
  * Constructor
  *
  * @param   array  $config  Configuration array
  */
 public function __construct($config = array())
 {
     if (empty($config['filter_fields'])) {
         $config['filter_fields'] = array('extension_name', 'pc.extension_name', 'owner_name', 'pc.owner_name', 'payment_name', 'pc.payment_name', 'state', 'pc.state');
     }
     parent::__construct($config);
 }
Example #3
0
 /**
  * Constructor
  *
  * @param   array  $config  Configuration array
  */
 public function __construct($config = array())
 {
     if (empty($config['filter_fields'])) {
         $config['filter_fields'] = array('payment_id', 'pc.payment_id', 'status', 'pc.status', 'transaction_id', 'pc.transaction_id');
     }
     parent::__construct($config);
 }
Example #4
0
 /**
  * Method to get a store id based on the model configuration state.
  *
  * This is necessary because the model is used by the component and
  * different modules that might need different sets of data or different
  * ordering requirements.
  *
  * @param   string  $id  An identifier string to generate the store id.
  *
  * @return  string  A store id.
  */
 protected function getStoreId($id = '')
 {
     foreach ($this->getFilterableColumns() as $name => $column) {
         $filterName = str_replace('.', '_', $name);
         $id .= ':' . $this->getState('filter.' . $filterName);
     }
     return parent::getStoreId($id);
 }
Example #5
0
 /**
  * Method to auto-populate the model state.
  *
  * This method should only be called once per instantiation and is designed
  * to be called on the first call to the getState() method unless the model
  * configuration flag to ignore the request is set.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @return  void
  */
 protected function populateState($ordering = null, $direction = null)
 {
     $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setState('filter.search', $search);
     $state = $this->getUserStateFromRequest($this->context . '.filter_state', 'filter_state');
     $this->setState('filter.state', $state);
     parent::populateState('a.name', 'asc');
 }
Example #6
0
 /**
  * Method to auto-populate the model state.
  *
  * This method should only be called once per instantiation and is designed
  * to be called on the first call to the getState() method unless the model
  * configuration flag to ignore the request is set.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @return  void
  */
 protected function populateState($ordering = null, $direction = null)
 {
     $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
     $this->setState('filter.search', $search);
     $state = $this->getUserStateFromRequest($this->context . '.filter_state', 'filter_state');
     $this->setState('filter.state', $state);
     $filter = $this->getUserStateFromRequest($this->context . '.filter_access', 'filter_access');
     $this->setState('filter.access', $filter);
     $filter = $this->getUserStateFromRequest($this->context . '.filter_language', 'filter_language');
     $this->setState('filter.language', $filter);
     parent::populateState('c.lft', 'asc');
 }
Example #7
0
 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @see     JModelLegacy
  */
 public function __construct($config = array())
 {
     if (!empty($config["tableName"])) {
         $this->tableName = $config["tableName"];
         $this->name = $config["tableName"];
     }
     if (!empty($config["context"])) {
         $this->context = strtolower($config["context"]);
     }
     if (!empty($config["paginationPrefix"])) {
         $this->paginationPrefix = strtolower($config["paginationPrefix"]);
     }
     if (!empty($config["filterFields"])) {
         $this->filter_fields = $config["filterFields"];
     }
     $this->modelConfig = $config;
     parent::__construct($config);
 }
Example #8
0
 /**
  * Method to auto-populate the model state.
  *
  * This method should only be called once per instantiation and is designed
  * to be called on the first call to the getState() method unless the model
  * configuration flag to ignore the request is set.
  *
  * Note. Calling getState in this method will result in recursion.
  *
  * @param   string  $ordering   An optional ordering field.
  * @param   string  $direction  An optional direction (asc|desc).
  *
  * @return  void
  *
  * @throws RuntimeException
  */
 protected function populateState($ordering = 'rank', $direction = 'ASC')
 {
     $event_id = JFactory::getApplication()->getUserStateFromRequest($this->context . '.event_id', 'event_id', 0, 'int');
     $event_id = $event_id ? $event_id : JFactory::getApplication()->input->getInt('event_id', 0);
     if (!$event_id) {
         throw new RuntimeException('event_id is required');
     }
     $this->setState('event_id', $event_id);
     return parent::populateState($ordering, $direction);
 }
Example #9
0
 /**
  * Method to get an array of data items. override to add content items
  *
  * @return  mixed  An array of data items on success, false on failure.
  *
  * @since   1.2
  */
 public function getItems()
 {
     $items = parent::getItems();
     return $items;
 }
Example #10
0
 /**
  * Method to get an array of data items.
  *
  * @return  mixed  An array of data items on success, false on failure.
  *
  * @since   12.2
  */
 public function getItems()
 {
     $items = parent::getItems();
     $table = RedcoreHelpersTranslation::getTranslationTable();
     $columns = (array) $table->columns;
     if (!empty($items)) {
         foreach ($items as $itemKey => $item) {
             $items[$itemKey]->translationStatus = RedcoreHelpersTranslation::getTranslationItemStatus($item, $columns);
         }
     }
     return $items;
 }
Example #11
0
 /**
  * Method to get an array of data items.
  *
  * @return  mixed  An array of data items on success, false on failure.
  *
  * @since   1.2
  */
 public function getItems()
 {
     // We are loading all webservice XML files with this
     $this->setXmlFiles();
     $items = parent::getItems();
     if (!empty($items)) {
         foreach ($items as $item) {
             $item->xml = !empty($this->installedXmlFiles[$item->client][$item->name][$item->version]) ? $this->installedXmlFiles[$item->client][$item->name][$item->version] : false;
             $item->scopes = json_decode($item->scopes, true);
         }
     }
     return $items;
 }
Example #12
0
 /**
  * Method to auto-populate the model state.
  *
  * @param   string  $ordering   [description]
  * @param   string  $direction  [description]
  *
  * @return  void
  */
 protected function populateState($ordering = 'i.name', $direction = 'ASC')
 {
     $app = JFactory::getApplication();
     $filterSearch = $this->getUserStateFromRequest($this->context . '.filter_search', 'filter_search');
     $this->setState('filter.search', $filterSearch);
     $value = $app->getUserStateFromRequest('global.list.limit', $this->paginationPrefix . 'limit', $app->getCfg('list_limit'), 'uint');
     $limit = $value;
     $this->setState('list.limit', $limit);
     $value = $app->getUserStateFromRequest($this->context . '.limitstart', $this->paginationPrefix . 'limitstart', 0);
     $limitstart = $limit != 0 ? floor($value / $limit) * $limit : 0;
     $this->setState('list.start', $limitstart);
     parent::populateState($ordering, $direction);
 }