UserModel::removePicture PHP 메소드

removePicture() 공개 메소드

Remove the photo from a user.
public removePicture ( integer $UserID )
$UserID integer
    public function removePicture($UserID)
    {
        // Grab the current photo.
        $User = $this->getID($UserID, DATASET_TYPE_ARRAY);
        $Photo = $User['Photo'];
        // Only attempt to delete a physical file, not a URL.
        if (!isUrl($Photo)) {
            $ProfilePhoto = changeBasename($Photo, 'p%s');
            $Upload = new Gdn_Upload();
            $Upload->delete($ProfilePhoto);
        }
        // Wipe the Photo field.
        $this->setField($UserID, 'Photo', null);
    }
UserModel