[COMPONENT][Avatar] Small refactor
This commit is contained in:
parent
9512890264
commit
969df371dd
@ -101,7 +101,7 @@ class Avatar extends Component
|
|||||||
/**
|
/**
|
||||||
* Get the cached avatar associated with the given Actor id, or the current user if not given
|
* Get the cached avatar associated with the given Actor id, or the current user if not given
|
||||||
*/
|
*/
|
||||||
public static function getAvatarUrl(int $actor_id, string $size = 'full', int $type = Router::ABSOLUTE_PATH): string
|
public static function getUrl(int $actor_id, string $size = 'full', int $type = Router::ABSOLUTE_PATH): string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return self::getAvatar($actor_id)->getUrl($size, $type);
|
return self::getAvatar($actor_id)->getUrl($size, $type);
|
||||||
|
@ -247,7 +247,7 @@ class Actor extends Entity
|
|||||||
|
|
||||||
public function getAvatarUrl(string $size = 'full')
|
public function getAvatarUrl(string $size = 'full')
|
||||||
{
|
{
|
||||||
return Avatar::getAvatarUrl($this->getId(), $size);
|
return Avatar::getUrl($this->getId(), $size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAvatarDimensions(string $size = 'full')
|
public function getAvatarDimensions(string $size = 'full')
|
||||||
|
@ -213,7 +213,12 @@ class Note extends Entity
|
|||||||
|
|
||||||
public function getActorAvatarUrl(string $size = 'full'): string
|
public function getActorAvatarUrl(string $size = 'full'): string
|
||||||
{
|
{
|
||||||
return Avatar::getAvatarUrl($this->getActorId(), $size);
|
return Avatar::getUrl($this->getActorId(), $size);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getFromId(int $note_id): self
|
||||||
|
{
|
||||||
|
return Cache::get("note-{$note_id}", fn () => DB::findOneBy('note', ['id' => $note_id]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNoteLanguageShortDisplay(): string
|
public function getNoteLanguageShortDisplay(): string
|
||||||
|
Loading…
Reference in New Issue
Block a user