49 lines
865 B
PHP
49 lines
865 B
PHP
<?php
|
|
namespace ContentNation\ActivityPub\Common;
|
|
|
|
class Stats {
|
|
/**
|
|
* user count
|
|
* @var int
|
|
*/
|
|
private $userCount = 0;
|
|
|
|
/**
|
|
* page count
|
|
* @var int
|
|
*/
|
|
private $pageCount = 0;
|
|
|
|
/**
|
|
* set user count
|
|
* @param int $count user count
|
|
* @return Stats current instance
|
|
*/
|
|
public function setUserCount(int $count) : Stats {
|
|
$this->userCount = $count;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* set page count
|
|
* @param int $count page count
|
|
* @return Stats current instance
|
|
*/
|
|
public function setPageCount(int $count) : Stats {
|
|
$this->pageCount = $count;
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* convert internal state to php array
|
|
* @return array<string,mixed>
|
|
*/
|
|
public function toObject() {
|
|
$ret = array(
|
|
"user_count"=> $this->userCount,
|
|
"status_count"=> $this->pageCount
|
|
);
|
|
return $ret;
|
|
}
|
|
}
|