\OCPIAvatar

This class provides avatar functionality

Summary

Methods
Constants
get()
exists()
set()
remove()
getFile()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

get()

get(integer  $size = 64) : boolean|\OCP\IImage

get the users avatar

Parameters

integer $size

size in px of the avatar, avatars are square, defaults to 64, -1 can be used to not scale the image

Returns

boolean|\OCP\IImage

containing the avatar or false if there's no image

exists()

exists() : boolean

Check if an avatar exists for the user

Returns

boolean

set()

set(\OCP\IImage|resource|string  $data) : void

sets the users avatar

Parameters

\OCP\IImage|resource|string $data

An image object, imagedata or path to set a new avatar

Throws

\Exception

if the provided file is not a jpg or png image

\Exception

if the provided image is not valid

\OC\NotSquareException

if the image is not square

remove()

remove() : void

remove the users avatar

getFile()

getFile(integer  $size) : \OCP\Files\File

Get the file of the avatar

Parameters

integer $size

-1 can be used to not scale the image

Throws

\OCP\Files\NotFoundException

Returns

\OCP\Files\File