Example #1
0
 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);
 }
Example #2
0
 /**
  * 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));
 }
Example #3
0
 /**
  * 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));
 }
Example #4
0
 /**
  * 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));
 }
Example #5
0
 /**
  * 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));
 }
Example #6
0
 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();
 }
Example #7
0
 /**
  * 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');
 }
Example #8
0
 /**
  * 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));
 }
Example #9
0
 /**
  * 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));
 }
Example #10
0
 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));
 }
Example #11
0
 /**
  * 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');
 }