diff options
author | Evan Prodromou <evan@status.net> | 2010-03-07 23:42:46 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-03-07 23:42:46 -0500 |
commit | e5541d09d0776e69cc276a3b3e93abcc42b15e55 (patch) | |
tree | deb1e1889784729d246e615a4d311ffa80fbaa80 /classes | |
parent | 7faf6ec75592764b829b1954352dfaf0329cdbf0 (diff) | |
parent | d59284d42d3735e393e5e99d027136d96778600d (diff) |
Merge branch 'master' of git@gitorious.org:statusnet/mainline
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Foreign_link.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php index ae8c22fd8..e47b2e309 100644 --- a/classes/Foreign_link.php +++ b/classes/Foreign_link.php @@ -113,4 +113,21 @@ class Foreign_link extends Memcached_DataObject return User::staticGet($this->user_id); } + // Make sure we only ever delete one record at a time + function safeDelete() + { + if (!empty($this->user_id) + && !empty($this->foreign_id) + && !empty($this->service)) + { + return $this->delete(); + } else { + common_debug(LOG_WARNING, + 'Foreign_link::safeDelete() tried to delete a ' + . 'Foreign_link without a fully specified compound key: ' + . var_export($this, true)); + return false; + } + } + } |