示例#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);
 }
示例#2
0
 /**
  * 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));
 }
示例#3
0
 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;
 }
示例#4
0
文件: video.php 项目: bizanto/Hooked
 public function store()
 {
     if (empty($source)) {
         $source = $this;
     }
     if (!$this->check()) {
         return false;
     }
     if (!parent::store()) {
         return false;
     }
     $this->setError('');
     return true;
 }
示例#5
0
文件: event.php 项目: bizanto/Hooked
 /**
  * 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);
 }
示例#6
0
 public function store()
 {
     return parent::store();
 }
示例#7
0
文件: photo.php 项目: bizanto/Hooked
 /**
  * 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);
     }
 }
示例#8
0
 /**
  * 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();
 }
示例#9
0
文件: group.php 项目: bizanto/Hooked
 /**
  * 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();
 }
示例#10
0
 /**
  * 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);
     }
 }