Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/ILIAS/UI/src/Component/Entity/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
*/
interface Entity extends Component
{
/**
* Returns the technical identifier of this entity.
*/
public function getId(): string|int;

//Priority Areas

/**
Expand Down
61 changes: 61 additions & 0 deletions components/ILIAS/UI/src/Component/Entity/EntityRetrieval.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

namespace ILIAS\UI\Component\Entity;

use ILIAS\UI\Component\Entity\Entity;
use ILIAS\Data\Range;
use ILIAS\Data\Order;

/**
* This describes how entities should be retrieved for different purposes.
*/
interface EntityRetrieval
{
/**
* This method is used by the Entity Listing to visualise all available entities.
*
* The signature mirrors {@see \ILIAS\UI\Component\Table\DataRetrieval::getRows()},
* so the UI framework can create expectations (order/range/grouping/etc.) globally
* and it allows future extension of additional (view/filter) controls.
*
* @return \Generator<Entity>
*/
public function getEntities(
\ILIAS\UI\Factory $ui_factory,
Range $range,
Order $order,
mixed $additional_viewcontrol_data,
mixed $filter_data,
mixed $additional_parameters,
): \Generator;

/**
* This method is used by the Prompt State to confirm a subset of entities.
*
* @param array<string|int> $entity_ids
* @return \Generator<Entity>
*/
public function getEntitiesByIds(
\ILIAS\UI\Factory $ui_factory,
Order $order,
array $entity_ids,
): \Generator;
}
8 changes: 6 additions & 2 deletions components/ILIAS/UI/src/Component/Entity/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ interface Factory
* The Standard Entity can (and should) be used to list system entities
* such as repository objects, users and similar.
* ---
* @param string|int $technical_identifier
* @param Symbol|Image|ShyButton|ShyLink|string $primary_visual_identifier
* @param Symbol|Image|ShyButton|ShyLink|string $secondary_visual_identifier
* @return \ILIAS\UI\Component\Entity\Standard
*/
public function standard(
Symbol | Image | ShyButton | ShyLink | string $primary_identifier,
Symbol | Image | ShyButton | ShyLink | string $secondary_identifier
string|int $technical_identifier,
Symbol|Image|ShyButton|ShyLink|string $primary_visual_identifier,
Symbol|Image|ShyButton|ShyLink|string $secondary_visual_identifier,
): Standard;
}
40 changes: 0 additions & 40 deletions components/ILIAS/UI/src/Component/Listing/Entity/DataRetrieval.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@

namespace ILIAS\UI\Component\Listing\Entity;

use ILIAS\UI\Component\Entity\Entity;
use ILIAS\UI\Component\Component;

/**
* Hand a record over to RecordToEntity and factor an Entity
* This is what an EntityListings looks like
*/
interface Mapping
interface Entity extends Component
{
public function map(mixed $record): Entity;
}
36 changes: 0 additions & 36 deletions components/ILIAS/UI/src/Component/Listing/Entity/EntityListing.php

This file was deleted.

5 changes: 4 additions & 1 deletion components/ILIAS/UI/src/Component/Listing/Entity/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

namespace ILIAS\UI\Component\Listing\Entity;

use ILIAS\UI\Component\Entity\EntityRetrieval;

/**
* This is what a factory for EntityListings looks like
*/
Expand All @@ -33,7 +35,8 @@ interface Factory
* defined concept and lists them one after the other.
*
* ---
* @param \ILIAS\UI\Component\Entity\EntityRetrieval $entity_retrieval
* @return \ILIAS\UI\Component\Listing\Entity\Standard
*/
public function standard(RecordToEntity $entity_mapping): Standard;
public function standard(EntityRetrieval $entity_retrieval): Standard;
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
/**
* This is what a Standard EntityListings looks like
*/
interface Standard extends EntityListing
interface Standard extends Entity
{
}
21 changes: 21 additions & 0 deletions components/ILIAS/UI/src/Component/Prompt/State/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

namespace ILIAS\UI\Component\Prompt\State;

use ILIAS\UI\URLBuilderToken;
use ILIAS\UI\URLBuilder;
use ILIAS\UI\Component;
use ILIAS\Data\URI;

Expand All @@ -45,12 +47,31 @@ interface Factory
* - The Prompt State is used for Prompts.
*
* ---
* @param \ILIAS\UI\Component\Prompt\IsPromptContent $content
* @return \ILIAS\UI\Component\Prompt\State\State
*/
public function show(
\ILIAS\UI\Component\Prompt\IsPromptContent $content
): State;

/**
* @param Component\Entity\EntityRetrieval $entity_retrieval
* @param URLBuilder $post_url
* @param URLBuilderToken $post_parameter
* @param array $entity_ids
* @param string $question
* @param string $title
* @return State
*/
public function confirm(
Component\Entity\EntityRetrieval $entity_retrieval,
URLBuilder $post_url,
URLBuilderToken $post_parameter,
array $entity_ids,
string $question,
string $title,
): State;

/**
* ---
* description:
Expand Down
4 changes: 4 additions & 0 deletions components/ILIAS/UI/src/Component/Prompt/State/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@

interface State extends Component
{
/**
* Get a Prompts State like this, but provide it with an explicit title.
*/
public function withTitle(string $title): static;
}
Loading
Loading