/** * Flush cached blocks when blocks are updated * * @param mixed $dataObject Original version of object * * @return boolean success flag. */ function update($dataObject = false) { self::blow('qvitterblocked:' . $this->blocker); self::blow('qvitterblocked:' . $this->blocked); return parent::update($dataObject); }
function _deleteBlocks() { $block = new Profile_block(); $block->blocker = $this->id; $block->delete(); // XXX delete group block? Reset blocker? }
function hasBlocked($other) { $block = Profile_block::get($this->id, $other->id); if (empty($block)) { $result = false; } else { $result = true; } return $result; }
function hasBlocked($other) { $block = Profile_block::exists($this, $other); return !empty($block); }
static function exists(Profile $blocker, Profile $blocked) { return Profile_block::pkeyGet(array('blocker' => $blocker->id, 'blocked' => $blocked->id)); }
function unblock($other) { # Get the block record $block = Profile_block::get($this->id, $other->id); if (!$block) { return false; } $result = $block->delete(); if (!$result) { common_log_db_error($block, 'DELETE', __FILE__); return false; } return true; }