daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Jan 13th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $changed = $this->owner->getChangedFields();
  2. if(isset($changed['AvatarID'])) {
  3.     $id = $changed['AvatarID']['before'];
  4.     $avatar = DataObject::get_by_id('Image', $id);
  5.     if($avatar && $avatar->exists()) {
  6.         $avatar->delete();
  7.     }
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top