/** * Delete a Consumer and related tokens and nonces * * XXX: Should this happen in an OAuthDataStore instead? * */ function delete() { // XXX: Is there any reason NOT to do this kind of cleanup? $this->_deleteTokens(); $this->_deleteNonces(); parent::delete(); }
/** * Delete a Consumer and related tokens and nonces * * XXX: Should this happen in an OAuthDataStore instead? * */ function delete($useWhere = false) { // XXX: Is there any reason NOT to do this kind of cleanup? $this->_deleteTokens(); $this->_deleteNonces(); return parent::delete($useWhere); }
function delete() { $filename = $this->filename; if (parent::delete()) { @unlink(Avatar::path($filename)); } }
/** * Wrapper for record insertion to update related caches */ function insert() { $result = parent::insert(); if ($result) { self::blow('qvitternotification:stream:%d', $this->to_profile_id); } return $result; }
function delete($useWhere = false) { $filename = $this->filename; if (file_exists(Avatar::path($filename))) { @unlink(Avatar::path($filename)); } return parent::delete($useWhere); }
function delete() { $f = File::staticGet('id', $this->file_id); if (!empty($f)) { $f->blowCache(); } return parent::delete(); }
/** * Wrapper for record insertion to update related caches */ function insert() { $result = parent::insert(); if ($result) { self::blow('reply:stream:%d', $this->profile_id); } return $result; }
function delete($useWhere = false) { try { $f = File::getByID($this->file_id); $f->blowCache(); } catch (NoResultException $e) { // ...alright, that's weird, but no File to delete anyway. } return parent::delete($useWhere); }
function delete() { $profile = Profile::staticGet('id', $this->user_id); $notice = Notice::staticGet('id', $this->notice_id); $result = null; if (Event::handle('StartDisfavorNotice', array($profile, $notice, &$result))) { $result = parent::delete(); self::blow('fave:list-ids:notice_id:%d', $this->notice_id); self::blow('popular'); if ($result) { Event::handle('EndDisfavorNotice', array($profile, $notice)); } } return $result; }
public function staticGet($k, $v = null) { return parent::staticGet(__CLASS__, $k, $v); }
function insert() { $result = parent::insert(); if ($result) { self::blow('profile:lists:%d', $this->tagger); } return $result; }
function update($orig = null) { $result = parent::update($orig); if ($result) { Config::_blowSettingsCache(); } return $result; }
public function delete($useWhere = false) { try { $oprofile = Ostatus_profile::getKV('feeduri', $this->getUri()); if ($oprofile instanceof Ostatus_profile) { // Check if there's a profile. If not, handle the NoProfileException below $profile = $oprofile->localProfile(); } } catch (NoProfileException $e) { // If the Ostatus_profile has no local Profile bound to it, let's clean it out at the same time $oprofile->delete(); } catch (NoUriException $e) { // FeedSub->getUri() can throw a NoUriException, let's just go ahead and delete it } return parent::delete($useWhere); }
function delete() { self::blow('spam_score:notice_ids'); self::blow('spam_score:notice_ids;last'); parent::delete(); }
function delete($useWhere = false) { self::blow('rsvp:for-event:%s', $this->id); return parent::delete($useWhere); }
/** * Handle cascading deletion, on the model of notice and profile. * * This should handle freeing up cached entries for the group's * id, nickname, URI, and aliases. There may be other areas that * are not de-cached in the UI, including the sidebar lists on * GroupsAction */ function delete() { if ($this->id) { // Safe to delete in bulk for now $related = array('Group_inbox', 'Group_block', 'Group_member', 'Related_group'); Event::handle('UserGroupDeleteRelated', array($this, &$related)); foreach ($related as $cls) { $inst = new $cls(); $inst->group_id = $this->id; if ($inst->find()) { while ($inst->fetch()) { $dup = clone $inst; $dup->delete(); } } } // And related groups in the other direction... $inst = new Related_group(); $inst->related_group_id = $this->id; $inst->delete(); // Aliases and the local_group entry need to be cleared explicitly // or we'll miss clearing some cache keys; that can make it hard // to create a new group with one of those names or aliases. $this->setAliases(array()); $local = Local_group::staticGet('group_id', $this->id); if ($local) { $local->delete(); } // blow the cached ids self::blow('user_group:notice_ids:%d', $this->id); } else { common_log(LOG_WARN, "Ambiguous user_group->delete(); skipping related tables."); } parent::delete(); }
function delete($useWhere = false) { $this->_deleteAppUsers(); $consumer = $this->getConsumer(); $consumer->delete(); return parent::delete($useWhere); }
function staticGet($k, $v = null) { return Managed_DataObject::staticGet('blog_entry', $k, $v); }
function delete() { $this->_deleteAppUsers(); $consumer = $this->getConsumer(); $consumer->delete(); parent::delete(); }
/** * Save this keypair into the database. * * Overloads default insert behavior to encode the live key objects * as a flat string for storage. * * @return mixed */ function insert() { $this->keypair = $this->toString(true); return parent::insert(); }
function multiGet($keyCol, $keyVals, $skipNulls = true) { return parent::multiGet('Task_Grader', $keyCol, $keyVals, $skipNulls); }
/** * Magic function called at serialize() time. * * We use this to drop a couple process-specific references * from DB_DataObject which can cause trouble in future * processes. * * @return array of variable names to include in serialization. */ function __sleep() { $vars = parent::__sleep(); $skip = array('_profile', '_groups', '_attachments', '_faves', '_replies', '_repeats'); return array_diff($vars, $skip); }
/** * Get an instance by compound key * * @param array $kv array of key-value mappings * * @return Realtime_channel object found, or null for no hits */ function pkeyGet($kv) { return Managed_DataObject::pkeyGet('Realtime_channel', $kv); }
function delete() { $result = parent::delete(); if ($result) { self::blow('profile_list:tagged_count:%d:%s', $this->tagger, $this->tag); } return $result; }
function delete($useWhere = false) { $result = parent::delete($useWhere); if ($result !== false) { self::blow('profile_list:subscriber_count:%d', $this->profile_tag_id); } return $result; }
function update($dataObject = false) { $result = parent::update($dataObject); if ($result !== false) { Config::_blowSettingsCache(); } return $result; }
public function delete($useWhere = false) { if (!empty($this->filename) && file_exists(File_thumbnail::path($this->filename))) { $deleted = @unlink(self::path($this->filename)); if (!$deleted) { common_log(LOG_ERR, sprintf('Could not unlink existing file: "%s"', self::path($this->filename))); } } return parent::delete($useWhere); }
/** * Magic function called at serialize() time. * * We use this to drop a couple process-specific references * from DB_DataObject which can cause trouble in future * processes. * * @return array of variable names to include in serialization. */ function __sleep() { $vars = parent::__sleep(); $skip = array('_user', '_group'); return array_diff($vars, $skip); }
public function insert() { $result = parent::insert(); if ($result === false) { common_log_db_error($this, 'INSERT', __FILE__); throw new ServerException(_('Failed to insert Conversation into database')); } return $result; }
/** * Magic function called at serialize() time. * * We use this to drop a couple process-specific references * from DB_DataObject which can cause trouble in future * processes. * * @return array of variable names to include in serialization. */ function __sleep() { $vars = parent::__sleep(); $skip = array('_profile'); return array_diff($vars, $skip); }