src/Hal/Serializer/CollectionNormalizer.php 1 location
|
@@ 114-120 (lines=7) @@
|
111 |
|
} |
112 |
|
|
113 |
|
$paginated = null; |
114 |
|
if ( |
115 |
|
is_array($object) || |
116 |
|
($paginated = $object instanceof PaginatorInterface) || |
117 |
|
$object instanceof \Countable && !$object instanceof PartialPaginatorInterface |
118 |
|
) { |
119 |
|
$data['totalItems'] = $paginated ? (int) $object->getTotalItems() : count($object); |
120 |
|
} |
121 |
|
|
122 |
|
if ($isPaginator) { |
123 |
|
$data['itemsPerPage'] = (int) $itemsPerPage; |
src/JsonApi/Serializer/CollectionNormalizer.php 1 location
|
@@ 119-125 (lines=7) @@
|
116 |
|
$data['data'][] = $item['data']; |
117 |
|
} |
118 |
|
|
119 |
|
if ( |
120 |
|
is_array($object) || |
121 |
|
($paginated = $object instanceof PaginatorInterface) || |
122 |
|
$object instanceof \Countable && !$object instanceof PartialPaginatorInterface |
123 |
|
) { |
124 |
|
$data['meta']['totalItems'] = $paginated ? (int) $object->getTotalItems() : count($object); |
125 |
|
} |
126 |
|
|
127 |
|
if ($isPaginator) { |
128 |
|
$data['meta']['itemsPerPage'] = (int) $itemsPerPage; |