本文整理汇总了PHP中CCache::inject方法的典型用法代码示例。如果您正苦于以下问题:PHP CCache::inject方法的具体用法?PHP CCache::inject怎么用?PHP CCache::inject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCache
的用法示例。
在下文中一共展示了CCache::inject方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(&$db)
{
parent::__construct('#__community_config', 'name', $db);
// Get cache object.
$oCache = CCache::inject($this);
// Remove all cache on configuration change.
$oCache->addMethod(CCache::METHOD_STORE, CCache::ACTION_REMOVE, COMMUNITY_CACHE_TAG_ALL);
}
示例2: __construct
/**
* Constructor
*/
public function __construct(&$db)
{
parent::__construct('#__community_events', 'id', $db);
// Get cache object.
$oCache = CCache::inject($this);
// Remove video cache on every delete & store
$oCache->addMethod(CCache::METHOD_DEL, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_EVENTS, COMMUNITY_CACHE_TAG_EVENTS_CAT));
$oCache->addMethod(CCache::METHOD_STORE, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_EVENTS, COMMUNITY_CACHE_TAG_EVENTS_CAT));
}
示例3: __construct
/**
* Constructor
*/
public function __construct(&$db)
{
parent::__construct('#__community_groups_category', 'id', $db);
// Get cache object.
$oCache = CCache::inject($this);
// Remove groups category cache on every delete & store
$oCache->addMethod(CCache::METHOD_DEL, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_GROUPS_CAT));
$oCache->addMethod(CCache::METHOD_STORE, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_GROUPS_CAT));
}
示例4: CTableVideosCategory
/**
* Constructor
*/
function CTableVideosCategory(&$db)
{
parent::__construct('#__community_videos_category', 'id', $db);
// Get cache object.
$oCache = CCache::inject($this);
// Remove video cache on every delete & store
$oCache->addMethod(CCache::METHOD_DEL, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_VIDEOS_CAT));
$oCache->addMethod(CCache::METHOD_STORE, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_VIDEOS_CAT));
}
示例5: __construct
/**
* Constructor
*/
function __construct(&$db)
{
parent::__construct('#__community_photos_albums', 'id', $db);
// Get cache object.
$oCache = CCache::inject($this);
// Remove photo cache on album delete.
$oCache->addMethod(CCache::METHOD_DEL, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_PHOTOS));
$oCache->addMethod(CCache::METHOD_STORE, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_ALBUMS));
}
示例6: __construct
function __construct()
{
// Get cache object.
$oCache = CCache::inject($this);
$oCache->addMethod('add', CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_ACTIVITIES));
$oCache->addMethod('removeOneActivity', CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_ACTIVITIES));
$oCache->addMethod('removeActivity', CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_ACTIVITIES));
$oCache->addMethod('deleteActivity', CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_ACTIVITIES));
parent::__construct();
}
示例7: __construct
/**
* Constructor
*/
public function __construct(&$db)
{
parent::__construct('#__community_events', 'id', $db);
// Get cache object.
$oCache = CCache::inject($this);
// Remove video cache on every delete & store
$oCache->addMethod(CCache::METHOD_DEL, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_EVENTS, COMMUNITY_CACHE_TAG_EVENTS_CAT));
$oCache->addMethod(CCache::METHOD_STORE, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_EVENTS, COMMUNITY_CACHE_TAG_EVENTS_CAT));
// Set default timezone to current user's timezone
$my = CFactory::getUser();
$this->offset = $my->getParam('timezone');
}
示例8: CommunityModelGroups
/**
* Constructor
*/
public function CommunityModelGroups()
{
parent::JCCModel();
$mainframe = JFactory::getApplication();
// Get pagination request variables
$limit = $mainframe->getCfg('list_limit') == 0 ? 5 : $mainframe->getCfg('list_limit');
$limitstart = JRequest::getVar('limitstart', 0, 'REQUEST');
// In case limit has been changed, adjust it
$limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
$this->setState('limit', $limit);
$this->setState('limitstart', $limitstart);
// Get cache object.
$oCache = CCache::inject($this);
$oCache->addMethod('setImage', CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_GROUPS));
}
示例9: __construct
/**
* Constructor
*/
public function __construct(&$db)
{
parent::__construct('#__community_photos_albums', 'id', $db);
// General Permission as initial permission
$this->permissions = 0;
$my = CFactory::getUser();
$params = $my->getParams();
if ($my->id > 0 && $params->get('privacyPhotoView')) {
$this->permissions = $params->get('privacyPhotoView');
}
// Get cache object.
$oCache = CCache::inject($this);
// Remove photo cache on album delete.
$oCache->addMethod(CCache::METHOD_DEL, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_PHOTOS));
$oCache->addMethod(CCache::METHOD_STORE, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_ALBUMS));
}
示例10: CommunityModelVideos
public function CommunityModelVideos()
{
parent::JCCModel();
$id = JRequest::getVar('videoid', 0, '', 'int');
$this->setId((int) $id);
$mainframe = JFactory::getApplication();
// Get the pagination request variables
$limit = $mainframe->getCfg('list_limit') == 0 ? 5 : $mainframe->getCfg('list_limit');
$limitstart = JRequest::getVar('limitstart', 0, 'REQUEST');
// In case limit has been changed, adjust limitstart accordingly
$limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
$this->setState('limit', $limit);
$this->setState('limitstart', $limitstart);
// Get cache object.
$oCache = CCache::inject($this);
$oCache->addMethod('updatePermission', CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_VIDEOS));
}
示例11: __construct
/**
* Constructor
*/
public function __construct(&$db)
{
parent::__construct('#__community_videos', 'id', $db);
require_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php';
CFactory::load('helpers', 'videos');
$config = CFactory::getConfig();
$this->_size = $config->get('videosSize');
$this->_width = CVideosHelper::getVideoSize('width');
$this->_height = CVideosHelper::getVideoSize('height');
$this->storage = 'file';
$this->hits = 0;
// Get cache object.
$oCache = CCache::inject($this);
// Remove video cache on every delete & store
$oCache->addMethod(CCache::METHOD_DEL, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_VIDEOS, COMMUNITY_CACHE_TAG_VIDEOS_CAT));
$oCache->addMethod(CCache::METHOD_STORE, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_VIDEOS, COMMUNITY_CACHE_TAG_VIDEOS_CAT));
// load helpers
CFactory::load('helpers', 'string');
}