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); }
/** * Constructor */ public function __construct(&$db) { parent::__construct('#__community_events_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_EVENTS_CAT)); $oCache->addMethod(CCache::METHOD_STORE, CCache::ACTION_REMOVE, array(COMMUNITY_CACHE_TAG_EVENTS_CAT)); }
public function delete($id) { $db =& JFactory::getDBO(); // Check if any groups are assigned into this category $strSQL = 'SELECT COUNT(*) FROM ' . $db->nameQuote('#__community_groups') . ' ' . 'WHERE ' . $db->nameQuote('categoryid') . '=' . $db->Quote($id); $db->setQuery($strSQL); $count = $db->loadResult(); if ($count <= 0) { // Only delete if no groups are assigned to this category. parent::delete($id); return true; } return false; }
public function store() { if (empty($source)) { $source = $this; } if (!$this->check()) { return false; } if (!parent::store()) { return false; } $this->setError(''); return true; }
/** * Override default delete method so that we can remove necessary data for Events. * * @params null * @return boolean True on success false otherwise. **/ public function delete($id = null) { $this->deleteAllMembers(); $this->deleteWalls(); return parent::delete($id); }
public function store() { return parent::store(); }
/** * Override parent's hit method as we don't really want to * carefully increment it every time a photo is viewed. **/ public function hit() { $session =& JFactory::getSession(); //@rule: We need to test if the album for this photo also has the hits. // otherwise it would not tally when photo has large hits but not the album. // The album hit() will take care of the album hits session correctly. $album =& JTable::getInstance('Album', 'CTable'); $album->load($this->albumid); $album->hit(); if ($session->get('photo-view-' . $this->id, false) == false) { parent::hit(); $session->set('photo-view-' . $this->id, true); } }
/** * Binds an array into this object's property * * @access public * @param $data mixed An associative array or object **/ public function store() { if (!$this->check()) { return false; } // Update activities as necessary $activityModel = CFactory::getModel('activities'); $activityModel->update(array('groupid' => $this->id), array('group_access' => $this->approvals)); return parent::store(); }
/** * Binds an array into this object's property * * @access public * @param $data mixed An associative array or object **/ function store() { if (!$this->check()) { return false; } return parent::store(); }
/** * Override parent's hit method as we don't really want to * carefully increment it every time a photo is viewed. **/ public function hit() { $session =& JFactory::getSession(); if ($session->get('album-view-' . $this->id, false) == false) { parent::hit(); $session->set('album-view-' . $this->id, true); } }