/** * */ public function onAfterWrite() { parent::onAfterWrite(); if (is_numeric($this->owner->ProfilePictureID)) { $profilePicture = File::get_one('File', 'ID = ' . $this->owner->ProfilePictureID); if (!empty($profilePicture)) { $profilePicture->setName(self::$ProfilePictureNamePrefix . md5($this->owner->ID) . '.' . $profilePicture->getExtension()); $profilePicture->write(false, false, false, true); } } }
function onAfterWrite() { parent::onAfterWrite(); if (is_numeric($this->owner->ProfilePictureID)) { $PP = DataObject::get_one('File', 'ID = ' . $this->owner->ProfilePictureID); if (!empty($PP)) { $PP->setName(self::$ProfilePictureNamePrefix . md5($this->owner->ID) . '.' . $PP->getExtension()); $ch = $PP->write(false, false, false, true); } } }