PlaceholderAvatar¶
-
class
OC\Avatar\PlaceholderAvatar¶ - This class represents a registered user’s placeholder avatar.It generates an image based on the user’s initials and caches it on storagefor faster retrieval, unlike the GuestAvatar.
Source: lib/private/Avatar/PlaceholderAvatar.php#49 Parent: OC\Avatar\Avatar
Properties¶
Methods¶
-
public
OC\Avatar\PlaceholderAvatar::__construct($folder, $user, $logger)¶ - UserAvatar constructor.
Source: Parameters: - $folder (
OCP\Files\SimpleFS\ISimpleFolder) The avatar files folder - $user (
OC\User\User) The user this class manages the avatar for - $logger (
Psr\Log\LoggerInterface) The logger
- $folder (
-
public
OC\Avatar\PlaceholderAvatar::exists()¶ - Check if an avatar exists for the user
Source: lib/private/Avatar/PlaceholderAvatar.php#80 Returns: bool
-
public
OC\Avatar\PlaceholderAvatar::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\PlaceholderAvatar::remove($silent=false)¶ - Removes the users avatar.
Source: lib/private/Avatar/PlaceholderAvatar.php#100
-
public
OC\Avatar\PlaceholderAvatar::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\PlaceholderAvatar::getDisplayName()¶ - Returns the user display name.
Source: lib/private/Avatar/PlaceholderAvatar.php#158 Returns: string
-
public
OC\Avatar\PlaceholderAvatar::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\PlaceholderAvatar::isCustomAvatar()¶ - Check if the avatar of a user is a custom uploaded one
Source: lib/private/Avatar/PlaceholderAvatar.php#180 Returns: bool