function delete() { $filename = $this->filename; if (parent::delete()) { @unlink(Avatar::path($filename)); } }
function delete() { $filename = $this->filename; if (parent::delete()) { //@unlink(Image::path($filename)); } }
/** * 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(); }
function delete() { $f = File::staticGet('id', $this->file_id); if (!empty($f)) { $f->blowCache(); } return parent::delete(); }
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(); if ($result) { Event::handle('EndDisfavorNotice', array($profile, $notice)); } } return $result; }
function delete() { $this->blowCaches(true); $this->blowFavesCache(true); $this->blowSubsCache(true); $this->query('BEGIN'); $related = array('Reply', 'Fave', 'Notice_tag', 'Group_inbox', 'Queue_item'); if (common_config('inboxes', 'enabled')) { $related[] = 'Notice_inbox'; } foreach ($related as $cls) { $inst = new $cls(); $inst->notice_id = $this->id; $inst->delete(); } $result = parent::delete(); $this->query('COMMIT'); }
function delete() { $this->_deleteAppUsers(); $consumer = $this->getConsumer(); $consumer->delete(); parent::delete(); }
function delete() { $result = parent::delete(); if ($result) { Config::_blowSettingsCache(); } return $result; }
function delete() { $result = parent::delete(); if ($result) { self::blow('profile_list:subscriber_count:%d', $this->profile_tag_id); } return $result; }
function delete() { $this->_deleteNotices(); $this->_deleteSubscriptions(); $this->_deleteMessages(); $this->_deleteTags(); $this->_deleteBlocks(); $this->delete_avatars(); // Warning: delete() will run on the batch objects, // not on individual objects. $related = array('Reply', 'Group_member'); Event::handle('ProfileDeleteRelated', array($this, &$related)); foreach ($related as $cls) { $inst = new $cls(); $inst->profile_id = $this->id; $inst->delete(); } parent::delete(); }
function delete() { // For auditing purposes, save a record that the notice // was deleted. // @fixme we have some cases where things get re-run and so the // insert fails. $deleted = Deleted_notice::staticGet('id', $this->id); if (!$deleted) { $deleted = new Deleted_notice(); $deleted->id = $this->id; $deleted->profile_id = $this->profile_id; $deleted->uri = $this->uri; $deleted->created = $this->created; $deleted->deleted = common_sql_now(); $deleted->insert(); } if (Event::handle('NoticeDeleteRelated', array($this))) { // Clear related records $this->clearReplies(); $this->clearRepeats(); $this->clearFaves(); $this->clearTags(); $this->clearGroupInboxes(); // NOTE: we don't clear inboxes // NOTE: we don't clear queue items } $result = parent::delete(); $this->blowOnDelete(); return $result; }
function delete() { // For auditing purposes, save a record that the notice // was deleted. $deleted = new Deleted_notice(); $deleted->id = $this->id; $deleted->profile_id = $this->profile_id; $deleted->uri = $this->uri; $deleted->created = $this->created; $deleted->deleted = common_sql_now(); $deleted->insert(); // Clear related records $this->clearReplies(); $this->clearRepeats(); $this->clearFaves(); $this->clearTags(); $this->clearGroupInboxes(); // NOTE: we don't clear inboxes // NOTE: we don't clear queue items $result = parent::delete(); $this->blowOnDelete(); return $result; }
/** * Gracefully delete one or many people tags * along with their members and subscriptions data * * @return boolean success */ function delete() { // force delete one item at a time. if (empty($this->id)) { $this->find(); while ($this->fetch()) { $this->delete(); } } Profile_tag::cleanup($this); Profile_tag_subscription::cleanup($this); self::blow('profile:lists:%d', $this->tagger); return parent::delete(); }
function delete() { $this->_deleteNotices(); $this->_deleteSubscriptions(); $this->_deleteMessages(); $this->_deleteTags(); $this->_deleteBlocks(); $related = array('Avatar', 'Reply', 'Group_member'); Event::handle('ProfileDeleteRelated', array($this, &$related)); foreach ($related as $cls) { $inst = new $cls(); $inst->profile_id = $this->id; $inst->delete(); } parent::delete(); }
function delete() { $result = parent::delete(); if ($result) { self::blow('profile_list:tagged_count:%d:%s', $this->tagger, $this->tag); } return $result; }
/** * 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() { try { $profile = $this->getProfile(); $profile->delete(); } catch (UserNoProfileException $unp) { common_log(LOG_INFO, "User {$this->nickname} has no profile; continuing deletion."); } $related = array('Fave', 'Confirm_address', 'Remember_me', 'Foreign_link', 'Invitation'); Event::handle('UserDeleteRelated', array($this, &$related)); foreach ($related as $cls) { $inst = new $cls(); $inst->user_id = $this->id; $inst->delete(); } $this->_deleteTags(); $this->_deleteBlocks(); parent::delete(); }