diff options
Diffstat (limited to 'Digitigrade/Model/Actor.php')
| -rw-r--r-- | Digitigrade/Model/Actor.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Digitigrade/Model/Actor.php b/Digitigrade/Model/Actor.php index 8a37b1c..d04c841 100644 --- a/Digitigrade/Model/Actor.php +++ b/Digitigrade/Model/Actor.php @@ -206,6 +206,18 @@ class Actor extends PushableModel implements RpcReceiver { } /** + * @return Actor[] a list of actors that would like to follow this actor + */ + public function findPendingFollowers(): array { + $relations = FollowRelation::findAllWithObject($this); + $relations = array_filter( + $relations, + fn(FollowRelation $rel) => $rel->status == FollowRelationStatus::PENDING + ); + return array_map(fn(FollowRelation $rel) => $rel->subject, $relations); + } + + /** * @return Actor[] a list of actors that both follow and are followed by this actor */ public function findMutualFollows(): array { |
