ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Repository\RecommendedContent\RoleRecommendationRetrieval Class Reference
+ Inheritance diagram for ILIAS\Repository\RecommendedContent\RoleRecommendationRetrieval:
+ Collaboration diagram for ILIAS\Repository\RecommendedContent\RoleRecommendationRetrieval:

Public Member Functions

 __construct (protected \ilRecommendedContentManager $manager, protected \ilTree $tree, protected int $role_id)
 
 getData (array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
 
 count (array $filter, array $parameters)
 
 isFieldNumeric (string $field)
 
 getData (array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
 
 count (array $filter, array $parameters)
 
 isFieldNumeric (string $field)
 

Protected Member Functions

 collectData ()
 
 formatPath (array $path)
 

Detailed Description

Definition at line 28 of file RoleRecommendationRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Repository\RecommendedContent\RoleRecommendationRetrieval::__construct ( protected \ilRecommendedContentManager  $manager,
protected \ilTree  $tree,
protected int  $role_id 
)

Definition at line 32 of file RoleRecommendationRetrieval.php.

36 {
37 }

Member Function Documentation

◆ collectData()

ILIAS\Repository\RecommendedContent\RoleRecommendationRetrieval::collectData ( )
protected

Definition at line 63 of file RoleRecommendationRetrieval.php.

63 : array
64 {
65 $data = [];
66
67 foreach ($this->manager->getRecommendationsOfRole($this->role_id) as $ref_id) {
68 $ref_id = (int) $ref_id;
69 $data[] = [
70 'id' => $ref_id,
71 'ref_id' => $ref_id,
73 'path' => $this->formatPath($this->tree->getPathFull($ref_id))
74 ];
75 }
76
77 return $data;
78 }
static _lookupObjectId(int $ref_id)
static _lookupTitle(int $obj_id)
$data
Definition: storeScorm.php:45

References $data, ilObject\_lookupObjectId(), ilObject\_lookupTitle(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ count()

ILIAS\Repository\RecommendedContent\RoleRecommendationRetrieval::count ( array  $filter,
array  $parameters 
)

◆ formatPath()

ILIAS\Repository\RecommendedContent\RoleRecommendationRetrieval::formatPath ( array  $path)
protected

Definition at line 80 of file RoleRecommendationRetrieval.php.

80 : string
81 {
82 return implode(' » ', array_column($path, 'title'));
83 }

◆ getData()

ILIAS\Repository\RecommendedContent\RoleRecommendationRetrieval::getData ( array  $fields,
?Range  $range = null,
?Order  $order = null,
array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 39 of file RoleRecommendationRetrieval.php.

45 : \Generator {
46 $data = $this->collectData();
47 $data = $this->applyOrder($data, $order);
48 $data = $this->applyRange($data, $range);
49
50 yield from $data;
51 }

◆ isFieldNumeric()

ILIAS\Repository\RecommendedContent\RoleRecommendationRetrieval::isFieldNumeric ( string  $field)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 58 of file RoleRecommendationRetrieval.php.

58 : bool
59 {
60 return $field === 'id' || $field === 'ref_id';
61 }

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