mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 10:46:43 +02:00
fix: overwrite getActorById to return app's Actor entity
This commit is contained in:
parent
40aa661289
commit
f2bc2f7e01
3 changed files with 14 additions and 4 deletions
|
|
@ -19,4 +19,18 @@ class ActorModel extends FediverseActorModel
|
|||
* @var string
|
||||
*/
|
||||
protected $returnType = Actor::class;
|
||||
|
||||
public function getActorById(int $id): ?Actor
|
||||
{
|
||||
$cacheName = config('Fediverse')
|
||||
->cachePrefix . "actor#{$id}";
|
||||
if (! ($found = cache($cacheName))) {
|
||||
$found = $this->find($id);
|
||||
|
||||
cache()
|
||||
->save($cacheName, $found, DECADE);
|
||||
}
|
||||
|
||||
return $found;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue