예제 #1
0
 /**
  * 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();
 }
예제 #2
0
 /**
  * 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);
 }
예제 #3
0
파일: Avatar.php 프로젝트: Grasia/bolotweet
 function delete()
 {
     $filename = $this->filename;
     if (parent::delete()) {
         @unlink(Avatar::path($filename));
     }
 }
예제 #4
0
 /**
  * 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;
 }
예제 #5
0
 function delete($useWhere = false)
 {
     $filename = $this->filename;
     if (file_exists(Avatar::path($filename))) {
         @unlink(Avatar::path($filename));
     }
     return parent::delete($useWhere);
 }
예제 #6
0
 function delete()
 {
     $f = File::staticGet('id', $this->file_id);
     if (!empty($f)) {
         $f->blowCache();
     }
     return parent::delete();
 }
예제 #7
0
 /**
  * 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;
 }
예제 #8
0
 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);
 }
예제 #9
0
파일: Fave.php 프로젝트: Grasia/bolotweet
 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;
 }
예제 #10
0
 public function staticGet($k, $v = null)
 {
     return parent::staticGet(__CLASS__, $k, $v);
 }
예제 #11
0
 function insert()
 {
     $result = parent::insert();
     if ($result) {
         self::blow('profile:lists:%d', $this->tagger);
     }
     return $result;
 }
예제 #12
0
파일: Config.php 프로젝트: Grasia/bolotweet
 function update($orig = null)
 {
     $result = parent::update($orig);
     if ($result) {
         Config::_blowSettingsCache();
     }
     return $result;
 }
예제 #13
0
 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);
 }
예제 #14
0
 function delete()
 {
     self::blow('spam_score:notice_ids');
     self::blow('spam_score:notice_ids;last');
     parent::delete();
 }
예제 #15
0
 function delete($useWhere = false)
 {
     self::blow('rsvp:for-event:%s', $this->id);
     return parent::delete($useWhere);
 }
예제 #16
0
 /**
  * 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();
 }
예제 #17
0
 function delete($useWhere = false)
 {
     $this->_deleteAppUsers();
     $consumer = $this->getConsumer();
     $consumer->delete();
     return parent::delete($useWhere);
 }
예제 #18
0
 function staticGet($k, $v = null)
 {
     return Managed_DataObject::staticGet('blog_entry', $k, $v);
 }
예제 #19
0
 function delete()
 {
     $this->_deleteAppUsers();
     $consumer = $this->getConsumer();
     $consumer->delete();
     parent::delete();
 }
예제 #20
0
 /**
  * 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();
 }
예제 #21
0
 function multiGet($keyCol, $keyVals, $skipNulls = true)
 {
     return parent::multiGet('Task_Grader', $keyCol, $keyVals, $skipNulls);
 }
예제 #22
0
 /**
  * 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);
 }
예제 #23
0
 /**
  * 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);
 }
예제 #24
0
 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;
 }
예제 #26
0
 function update($dataObject = false)
 {
     $result = parent::update($dataObject);
     if ($result !== false) {
         Config::_blowSettingsCache();
     }
     return $result;
 }
예제 #27
0
 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);
 }
예제 #28
0
 /**
  * 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);
 }
예제 #29
0
 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;
 }
예제 #30
0
파일: User.php 프로젝트: Grasia/bolotweet
 /**
  * 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);
 }