fixed hiding of total in case of 0 items
This commit is contained in:
parent
9464b28e11
commit
1b92265402
1 changed files with 2 additions and 2 deletions
|
@ -10,7 +10,7 @@ namespace Federator\Data\ActivityPub\Common;
|
|||
|
||||
class Collection extends APObject
|
||||
{
|
||||
protected int $totalItems = 0;
|
||||
protected int $totalItems = -1;
|
||||
private string $first = '';
|
||||
private string $last = '';
|
||||
|
||||
|
@ -28,7 +28,7 @@ class Collection extends APObject
|
|||
{
|
||||
$return = parent::toObject();
|
||||
$return['type'] = 'Collection';
|
||||
if ($this->totalItems > 0) {
|
||||
if ($this->totalItems >= 0) {
|
||||
$return['totalItems'] = $this->totalItems;
|
||||
}
|
||||
if ($this->first !== '') {
|
||||
|
|
Loading…
Add table
Reference in a new issue