ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
ByCreationDate.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\ResourceStorage\Collection\Sorter
;
22
23
use
ILIAS\ResourceStorage\Identification\ResourceIdentification
;
24
31
class
ByCreationDate
extends
AbstractBaseSorter
implements
CollectionSorter
32
{
33
protected
function
sortResourceIdentification
(array $identifications): array
34
{
35
usort($identifications,
function
(
ResourceIdentification
$a
,
ResourceIdentification
$b
):
int
{
36
$a_creation_date = $this->resource_builder->get(
$a
)->getCurrentRevision()->getInformation(
37
)->getCreationDate();
38
$b_creation_date = $this->resource_builder->get(
$b
)->getCurrentRevision()->getInformation(
39
)->getCreationDate();
40
return
$a_creation_date->diff($b_creation_date)->invert;
41
});
42
return
$identifications;
43
}
44
}
ILIAS\ResourceStorage\Collection\Sorter\AbstractBaseSorter
Class AbstractBaseSorter.
Definition:
AbstractBaseSorter.php:33
ILIAS\ResourceStorage\Collection\Sorter\ByCreationDate
Class ByCreationDate.
Definition:
ByCreationDate.php:32
ILIAS\ResourceStorage\Collection\Sorter\ByCreationDate\sortResourceIdentification
sortResourceIdentification(array $identifications)
Definition:
ByCreationDate.php:33
ILIAS\ResourceStorage\Identification\ResourceIdentification
Class ResourceIdentification.
Definition:
ResourceIdentification.php:31
ILIAS\ResourceStorage\Collection\Sorter\CollectionSorter
Interface CollectionSorter.
Definition:
CollectionSorter.php:32
ILIAS\ResourceStorage\Collection\Sorter
Definition:
AbstractBaseSorter.php:21
Vendor\Package\$b
$b
Definition:
example_cleaned.php:49
Vendor\Package\$a
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
Definition:
example_cleaned.php:49
components
ILIAS
ResourceStorage
src
Collection
Sorter
ByCreationDate.php
Generated on Sat Oct 18 2025 23:03:38 for ILIAS by
1.9.4 (using
Doxyfile
)