Back to ApcuStorage class

Method remove

public bool
remove
(mixed $id, mixed $group)
Remove a cached data entry by ID and group
Parameters
  • string $id The cache data ID
  • string $group The cache data group
Returns
  • bool
Since
  • 3.5
Class: ApcuStorage
Project: Joomla

Method remove - Source code

/**
 * Remove a cached data entry by ID and group
 *
 * @param   string  $id     The cache data ID
 * @param   string  $group  The cache data group
 *
 * @return  boolean
 *
 * @since   3.5
 */
public function remove($id, $group)
{
    $cache_id = $this->_getCacheId($id, $group);
    // The apcu_delete function returns false if the ID does not exist
    if (apcu_exists($cache_id)) {
        return apcu_delete($cache_id);
    }
    return true;
}