ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection Class Reference

Class ResourceCollection. More...

+ Collaboration diagram for ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection:

Public Member Functions

 __construct (private ResourceCollectionIdentification $identification, private int $owner, string $title)
 
 getIdentification ()
 
 hasSpecificOwner ()
 
 getOwner ()
 
 getTitle ()
 
 add (ResourceIdentification $identification)
 
 remove (ResourceIdentification $identification)
 
 isIn (ResourceIdentification $identification)
 
 getResourceIdentifications ()
 
 count ()
 
 clear ()
 

Data Fields

const NO_SPECIFIC_OWNER = -1
 

Private Attributes

array $resource_identifications = []
 
string $title = 'default'
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::__construct ( private ResourceCollectionIdentification  $identification,
private int  $owner,
string  $title 
)

Definition at line 41 of file ResourceCollection.php.

42  {
43  }

Member Function Documentation

◆ add()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::add ( ResourceIdentification  $identification)

Definition at line 65 of file ResourceCollection.php.

References ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection\isIn().

Referenced by ILIAS\Repository\IRSS\IRSSWrapper\addEntryOfZipResourceToCollection(), ILIAS\Repository\IRSS\IRSSWrapper\importFilesFromDirectoryToCollection(), ILIAS\Repository\IRSS\IRSSWrapper\importFilesFromLegacyUploadToCollection(), and ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\Sorter\AbstractBaseSorter\sort().

65  : void
66  {
67  if ($this->isIn($identification)) {
68  return;
69  }
70  $this->resource_identifications[] = $identification;
71  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::clear ( )

Definition at line 104 of file ResourceCollection.php.

Referenced by ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\Sorter\AbstractBaseSorter\sort().

104  : void
105  {
106  $this->resource_identifications = [];
107  }
+ Here is the caller graph for this function:

◆ count()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::count ( )

Definition at line 99 of file ResourceCollection.php.

99  : int
100  {
101  return count($this->resource_identifications);
102  }

◆ getIdentification()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::getIdentification ( )

Definition at line 45 of file ResourceCollection.php.

Referenced by ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\Collections\store(), and ILIAS\ResourceStorage\Resource\Repository\CollectionDBRepository\update().

45  : ResourceCollectionIdentification
46  {
47  return $this->identification;
48  }
+ Here is the caller graph for this function:

◆ getOwner()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::getOwner ( )

Definition at line 55 of file ResourceCollection.php.

Referenced by ILIAS\ResourceStorage\Resource\Repository\CollectionDBRepository\update().

55  : int
56  {
57  return $this->owner;
58  }
+ Here is the caller graph for this function:

◆ getResourceIdentifications()

◆ getTitle()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::getTitle ( )

◆ hasSpecificOwner()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::hasSpecificOwner ( )

Definition at line 50 of file ResourceCollection.php.

50  : bool
51  {
52  return $this->owner !== self::NO_SPECIFIC_OWNER;
53  }

◆ isIn()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::isIn ( ResourceIdentification  $identification)

Definition at line 81 of file ResourceCollection.php.

References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().

Referenced by ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection\add().

81  : bool
82  {
83  foreach ($this->resource_identifications as $i) {
84  if ($i->serialize() === $identification->serialize()) {
85  return true;
86  }
87  }
88  return false;
89  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove()

ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::remove ( ResourceIdentification  $identification)

Definition at line 73 of file ResourceCollection.php.

References ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().

73  : void
74  {
75  $this->resource_identifications = array_filter(
76  $this->resource_identifications,
77  fn(ResourceIdentification $i): bool => $i->serialize() !== $identification->serialize()
78  );
79  }
+ Here is the call graph for this function:

Field Documentation

◆ $resource_identifications

array ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::$resource_identifications = []
private

◆ $title

string ILIAS\Export\ImportHandler\Parser\NodeInfo\Collection\ResourceCollection::$title = 'default'
private

◆ NO_SPECIFIC_OWNER


The documentation for this class was generated from the following file: