UserAvatar¶
-
class
OC\Avatar\UserAvatar¶ - This class represents a registered user’s avatar.
Source: lib/private/Avatar/UserAvatar.php#47 Parent: OC\Avatar\Avatar
Properties¶
Methods¶
-
public
OC\Avatar\UserAvatar::__construct($folder, $l, $user, $logger, $config)¶ - UserAvatar constructor.
Source: Parameters: - $folder (
OCP\Files\SimpleFS\ISimpleFolder) The avatar files folder - $l (
OCP\IL10N) The localization helper - $user (
OC\User\User) The user this class manages the avatar for - $logger (
Psr\Log\LoggerInterface) The logger - $config (
OCP\IConfig) The configuration
- $folder (
-
public
OC\Avatar\UserAvatar::exists()¶ - Check if an avatar exists for the user
Source: lib/private/Avatar/UserAvatar.php#87 Returns: bool
-
public
OC\Avatar\UserAvatar::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
- $data (
-
public
OC\Avatar\UserAvatar::remove($silent=false)¶ - Removes the users avatar.
Source: lib/private/Avatar/UserAvatar.php#202 Returns: void Throws: \OCP\Files\NotPermittedExceptionThrows: \OCP\PreConditionNotMetExceptionThrows: \OCP\Files\NotPermittedExceptionThrows: \OCP\PreConditionNotMetException
-
public
OC\Avatar\UserAvatar::getFile($size)¶ - Returns the avatar for an user.If there is no avatar file yet, one is generated.
Source: Parameters: - $size (int)
Returns: Throws: Throws: Throws: Throws: Throws: Throws: Throws: Throws: Throws:
-
public
OC\Avatar\UserAvatar::getDisplayName()¶ - Returns the user display name.
Source: lib/private/Avatar/UserAvatar.php#308 Returns: string
-
public
OC\Avatar\UserAvatar::userChanged($feature, $oldValue, $newValue)¶ - Handles user changes.
Source: Parameters: - $feature (string) The changed feature
- $oldValue (mixed) The previous value
- $newValue (mixed) The new value
Throws: Throws: Throws: Throws:
-
public
OC\Avatar\UserAvatar::isCustomAvatar()¶ - Check if the avatar of a user is a custom uploaded one
Source: lib/private/Avatar/UserAvatar.php#335 Returns: bool