2018-12-08 00:02:18 +01:00
|
|
|
<?php
|
2019-11-18 20:57:00 +01:00
|
|
|
namespace Activitypub\Peer;
|
2018-12-08 00:02:18 +01:00
|
|
|
|
2019-02-24 13:01:28 +01:00
|
|
|
/**
|
|
|
|
* ActivityPub Followers DB-Class
|
|
|
|
*
|
|
|
|
* @author Matthias Pfefferle
|
|
|
|
*/
|
2019-02-24 12:07:41 +01:00
|
|
|
class Followers {
|
2018-12-08 00:02:18 +01:00
|
|
|
|
2018-12-20 11:33:08 +01:00
|
|
|
public static function get_followers( $author_id ) {
|
2023-04-21 15:57:21 +02:00
|
|
|
_deprecated_function( __METHOD__, '1.0.0', '\Activitypub\Collection\Followers::get_followers' );
|
2019-02-17 21:09:24 +01:00
|
|
|
|
2023-04-21 15:57:21 +02:00
|
|
|
$items = array(); // phpcs:ignore
|
|
|
|
foreach ( \Activitypub\Collection\Followers::get_followers( $author_id ) as $follower ) {
|
|
|
|
$items[] = $follower->name; // phpcs:ignore
|
2019-02-17 21:09:24 +01:00
|
|
|
}
|
2023-04-21 15:57:21 +02:00
|
|
|
return $items;
|
2018-12-08 00:02:18 +01:00
|
|
|
}
|
|
|
|
|
2019-08-21 10:38:43 +02:00
|
|
|
public static function count_followers( $author_id ) {
|
2023-04-21 15:57:21 +02:00
|
|
|
_deprecated_function( __METHOD__, '1.0.0', '\Activitypub\Collection\Followers::count_followers' );
|
2019-08-21 10:38:43 +02:00
|
|
|
|
2023-04-21 15:57:21 +02:00
|
|
|
return \Activitypub\Collection\Followers::count_followers( $author_id );
|
2019-08-21 10:38:43 +02:00
|
|
|
}
|
|
|
|
|
2018-12-08 00:02:18 +01:00
|
|
|
public static function add_follower( $actor, $author_id ) {
|
2023-04-21 15:57:21 +02:00
|
|
|
_deprecated_function( __METHOD__, '1.0.0', '\Activitypub\Collection\Followers::add_follower' );
|
2019-02-02 23:56:05 +01:00
|
|
|
|
2023-04-21 15:57:21 +02:00
|
|
|
return \Activitypub\Collection\Followers::add_followers( $author_id, $actor );
|
2018-12-08 00:02:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function remove_follower( $actor, $author_id ) {
|
2023-04-21 15:57:21 +02:00
|
|
|
_deprecated_function( __METHOD__, '1.0.0', '\Activitypub\Collection\Followers::remove_follower' );
|
2018-12-08 00:02:18 +01:00
|
|
|
|
2023-04-21 15:57:21 +02:00
|
|
|
return \Activitypub\Collection\Followers::remove_follower( $author_id, $actor );
|
2018-12-08 00:02:18 +01:00
|
|
|
}
|
|
|
|
}
|