Back to Cache class

Method store

public bool
store
(mixed $data, mixed $id, mixed $group = null)
Store the cached data by ID and group
Parameters
  • mixed $data The data to store
  • string $id The cache data ID
  • string $group The cache data group
Returns
  • bool
Since
  • 1.7.0
Class: Cache
Project: Joomla

Method store - Source code

/**
 * Store the cached data by ID and group
 *
 * @param   mixed   $data   The data to store
 * @param   string  $id     The cache data ID
 * @param   string  $group  The cache data group
 *
 * @return  boolean
 *
 * @since   1.7.0
 */
public function store($data, $id, $group = null)
{
    if (!$this->getCaching()) {
        return false;
    }
    // Get the default group
    $group = $group ?: $this->_options['defaultgroup'];
    // Get the storage and store the cached data
    return $this->_getStorage()->store($id, $group, $data);
}