IAvatar¶
-
interface
OCP\IAvatar¶ - This class provides avatar functionality
Implemented by: OC\Avatar\AvatarSource: lib/public/IAvatar.php#37
Methods¶
-
public
OCP\IAvatar::get($size=64)¶ - get the users avatar
Source: Parameters: - $size (int) size in px of the avatar, avatars are square, defaults to 64, -1 can be used to not scale the image
Returns: bool |
\OCP\IImagecontaining the avatar or false if there’s no imageSince: 6.0.0 - size of -1 was added in 9.0.0
-
public
OCP\IAvatar::exists()¶ - Check if an avatar exists for the user
Source: lib/public/IAvatar.php#53 Returns: bool Since: 8.1.0
-
public
OCP\IAvatar::isCustomAvatar()¶ - Check if the avatar of a user is a custom uploaded one
Source: lib/public/IAvatar.php#61 Returns: bool Since: 14.0.0
-
public
OCP\IAvatar::set($data)¶ - sets the users avatar
Source: Parameters: - $data (
OCP\IImage| resource | string) An image object, imagedata or path to set a new avatar
Throws: \Exceptionif the provided file is not a jpg or png imageThrows: \Exceptionif the provided image is not validThrows: \OC\NotSquareExceptionif the image is not squareThrows: \Exceptionif the provided file is not a jpg or png imageThrows: \Exceptionif the provided image is not validThrows: \OC\NotSquareExceptionif the image is not squareThrows: \Exceptionif the provided file is not a jpg or png imageThrows: \Exceptionif the provided image is not validThrows: \OC\NotSquareExceptionif the image is not squareReturns: void
Since: 6.0.0
- $data (
-
public
OCP\IAvatar::remove()¶ - remove the users avatar
Source: lib/public/IAvatar.php#79 Returns: void Since: 6.0.0
-
public
OCP\IAvatar::getFile($size)¶ - Get the file of the avatar
Source: Parameters: - $size (int) -1 can be used to not scale the image
Returns: Throws: Since: 9.0.0
-
public
OCP\IAvatar::avatarBackgroundColor($text)¶ Source: Parameters: - $text (string)
Returns: \OCP\ColorObject containting r g b int in the range [0, 255]Since: 14.0.0
-
public
OCP\IAvatar::userChanged($feature, $oldValue, $newValue)¶ - Handle a changed user
Source: lib/public/IAvatar.php#101 Since: 13.0.0