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
2 changes: 1 addition & 1 deletion components/ILIAS/Component/src/Activities/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
namespace ILIAS\Component\Activities;

use ILIAS\Component\Dependencies\Name;
use ILIAS\UI\Component\Input\Control\Form\FormInput;
use ILIAS\Data\Result;
use ILIAS\Data\Text;
use ILIAS\Data\Description;
use ILIAS\UI\Component\Input\Container\Form\FormInput;

/**
* An Activity is an action on the domain layer action of a component.
Expand Down
59 changes: 59 additions & 0 deletions components/ILIAS/Component/src/Activities/ObjectActivity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?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\Component\Activities;

use ILIAS\UI\Component\Input\Container\Form\FormInput;
use ILIAS\UI\Component\Input\Input;

/**
* An Activity that refers to a certain object in the system. This also is a
* generic interface but a subset of inputs is fixed.
*
* This does not necessarily need to refer to an ilObject, but can also be used
* to refer to any objects internal to a given component, such as questions,
* memberships or certain results.
*/
interface ObjectActivity extends Activity
{
/**
* @inheritdoc
*
* For an ObjectActivity, this needs to return an input with one field named
* "id" that can accept a string value.
*/
public function getInputDescription(): FormInput;

/**
* Works just like `getInputDescription` but checks if that description
* matches the spec.
*
* @throws \LogicException if there is no "id" field in the Input.
*/
public function getCheckedInputDescription(): Input;

/**
* To allow consumers to build an understanding of internal object structure of
* a component, an ObjectActivity needs to tell a "type" of object it touches.
*
* The type should be a short alphanumeric string.
*/
public function getTargetType(): string;
}
4 changes: 3 additions & 1 deletion components/ILIAS/Component/src/Activities/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@

namespace ILIAS\Component\Activities;

use ILIAS\Data\Range;

interface Repository
{
/**
* Get all activities where the name matches the provided regexp.
*
* @param string $name_matcher as preg_match can understand
* @return Iterator<string, Activity> where keys are the name
* @return \Iterator<string, Activity> where keys are the name
*/
public function getActivitiesByName(string $name_matcher, ?ActivityType $type = null, ?Range $range = null): \Iterator;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

namespace ILIAS\Component\Activities;

use ILIAS\Data\Range;

class StaticRepository implements Repository
{
protected array $activities = [];
Expand Down
4 changes: 2 additions & 2 deletions components/ILIAS/Setup/src/Activities/GetStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
namespace ILIAS\Setup\Activities;

use ILIAS\Component\Dependencies\Name;
use ILIAS\UI\Component\Input\Control\Form\FormInput;
use ILIAS\Data\Result;
use ILIAS\Data\Text;
use ILIAS\UI\Component\Input\Container\Form\FormInput;

/**
* This is a stub...
Expand All @@ -34,7 +34,7 @@ public function getDescription(): Text\SimpleDocumentMarkdown
{
}

public function getInputDescription(): \ILIAS\UI\Component\Input\Control\Form\FormInput
public function getInputDescription(): FormInput
{
}

Expand Down