ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
ILIAS\Exercise\Search\SubitemPropertiesReader Class Reference
+ Inheritance diagram for ILIAS\Exercise\Search\SubitemPropertiesReader:
+ Collaboration diagram for ILIAS\Exercise\Search\SubitemPropertiesReader:

Public Member Functions

 init (Container $dic)
 
 getSubitemProperties (PropertiesFactory $factory, int $parent_ref_id, ID ... $subitem_ids)
 Order of the output should respect the order of the subitem_ids. More...
 
 init (Container $dic)
 
 getSubitemProperties (PropertiesFactory $factory, int $parent_ref_id, ID ... $subitem_ids)
 Order of the output should respect the order of the subitem_ids. More...
 

Static Public Member Functions

static type ()
 Type of the parent object. More...
 
static type ()
 Type of the parent object. More...
 

Protected Member Functions

 isAssignmentVisible (int $ref_id, int $subitem_id)
 

Protected Attributes

ilLanguage $lng
 
DataFactory $data_factory
 
ilAccess $access
 
PermanentLinkManager $permanent_link
 

Detailed Description

Definition at line 34 of file SubitemPropertiesReader.php.

Member Function Documentation

◆ getSubitemProperties()

ILIAS\Exercise\Search\SubitemPropertiesReader::getSubitemProperties ( PropertiesFactory  $factory,
int  $parent_ref_id,
ID ...  $subitem_ids 
)

Order of the output should respect the order of the subitem_ids.

Subitems that should not be shown in the search results should not be included in the output (read access on the parent object is already checked).

Returns
Properties[]

Implements ILIAS\Search\Presentation\Result\Subitem\PropertiesReader.

Definition at line 55 of file SubitemPropertiesReader.php.

59 : Generator {
60 foreach ($subitem_ids as $subitem_id) {
61 if (!$this->isAssignmentVisible($parent_ref_id, (int) $subitem_id->id())) {
62 continue;
63 }
64 $link = $this->data_factory->uri(
65 $this->permanent_link->getPermanentLink($parent_ref_id, (int) $subitem_id->id())
66 );
67 yield $factory->get(
68 $subitem_id,
69 ilExAssignment::lookupTitle((int) $subitem_id->id()),
70 $link,
71 false,
72 $this->lng->txt('exc_assignment')
73 );
74 }
75 }
static lookupTitle(int $a_id)

References ILIAS\Search\Presentation\Result\Subitem\PropertiesFactory\get(), ILIAS\Exercise\Search\SubitemPropertiesReader\isAssignmentVisible(), and ilExAssignment\lookupTitle().

+ Here is the call graph for this function:

◆ init()

ILIAS\Exercise\Search\SubitemPropertiesReader::init ( Container  $dic)

Implements ILIAS\Search\Presentation\Result\Subitem\PropertiesReader.

Definition at line 46 of file SubitemPropertiesReader.php.

46 : void
47 {
48 $this->lng = $dic->language();
49 $this->lng->loadLanguageModule('exc');
50 $this->data_factory = new DataFactory();
51 $this->access = $dic->access();
52 $this->permanent_link = $dic->exercise()->internal()->gui()->permanentLink();
53 }
$dic
Definition: ltiresult.php:33

References $dic, ILIAS\DI\Container\access(), ILIAS\Repository\access(), ILIAS\DI\Container\language(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ isAssignmentVisible()

ILIAS\Exercise\Search\SubitemPropertiesReader::isAssignmentVisible ( int  $ref_id,
int  $subitem_id 
)
protected

Definition at line 77 of file SubitemPropertiesReader.php.

80 : bool {
81 if ($this->access->checkAccess('write', '', $ref_id)) {
82 return true;
83 }
85 }
static lookupAssignmentOnline(int $a_ass_id)
$ref_id
Definition: ltiauth.php:66

Referenced by ILIAS\Exercise\Search\SubitemPropertiesReader\getSubitemProperties().

+ Here is the caller graph for this function:

◆ type()

static ILIAS\Exercise\Search\SubitemPropertiesReader::type ( )
static

Type of the parent object.

Should do nothing but return a string, is called during setup.

Implements ILIAS\Search\Presentation\Result\Subitem\PropertiesReader.

Definition at line 41 of file SubitemPropertiesReader.php.

41 : string
42 {
43 return 'exc';
44 }

Field Documentation

◆ $access

ilAccess ILIAS\Exercise\Search\SubitemPropertiesReader::$access
protected

Definition at line 38 of file SubitemPropertiesReader.php.

◆ $data_factory

DataFactory ILIAS\Exercise\Search\SubitemPropertiesReader::$data_factory
protected

Definition at line 37 of file SubitemPropertiesReader.php.

◆ $lng

ilLanguage ILIAS\Exercise\Search\SubitemPropertiesReader::$lng
protected

Definition at line 36 of file SubitemPropertiesReader.php.

◆ $permanent_link

PermanentLinkManager ILIAS\Exercise\Search\SubitemPropertiesReader::$permanent_link
protected

Definition at line 39 of file SubitemPropertiesReader.php.


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