Пример #1
0
 /**
  * Method to get a store id based on model configuration state.
  *
  * @param   string  $id  A prefix for the store id.
  *
  * @return  string       A store id.
  */
 protected function getStoreId($id = '')
 {
     // Compile the store id.
     $id .= ':' . $this->getState('filter.search');
     $id .= ':' . $this->getState('filter.published');
     return parent::getStoreId($id);
 }
Пример #2
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 = null, $direction = null)
 {
     $prid = JFactory::getApplication()->getUserStateFromRequest($this->context . '.projectround_id', 'projectround_id', 0, 'int');
     if (!$prid) {
         throw new RuntimeException('projectround id is required');
     }
     $this->setState('projectround_id', $prid);
     return parent::populateState($ordering, $direction);
 }