scimserviceprovider/lib/Responses/SCIMListResponse.php

29 lines
655 B
PHP
Raw Permalink Normal View History

2022-04-29 13:58:37 +00:00
<?php
namespace OCA\SCIMServiceProvider\Responses;
/**
* Class SCIMListResponse
*
2022-04-29 13:58:37 +00:00
*/
2024-02-06 10:32:35 +00:00
class SCIMListResponse extends SCIMJSONResponse {
2022-05-02 10:21:25 +00:00
/**
* constructor of SCIMListResponse
2024-02-06 10:32:35 +00:00
* @param array $items array that should be transformed
2022-04-29 13:58:37 +00:00
* @since 6.0.0
*/
2024-02-06 10:32:35 +00:00
public function __construct(array $items = [], int $startIndex = 1, int $total = null) {
if ($total === null) {
$total = sizeof($items);
}
$data = [
'schemas' => ['urn:ietf:params:scim:api:messages:2.0:ListResponse'],
2024-02-06 10:32:35 +00:00
'startIndex' => $startIndex,
'itemsPerPage' => sizeof($items),
'totalResults' => $total,
'Resources' => $items,
];
2024-02-06 10:32:35 +00:00
parent::__construct($data);
2022-04-29 13:58:37 +00:00
}
}