ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Container\Skills\ContProfileRetrieval Class Reference
+ Inheritance diagram for ILIAS\Container\Skills\ContProfileRetrieval:
+ Collaboration diagram for ILIAS\Container\Skills\ContProfileRetrieval:

Public Member Functions

 __construct (protected SkillProfileService $profile_service, protected \ilSkillManagementSettings $skmg_settings, protected int $cont_member_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)
 

Detailed Description

Definition at line 29 of file ContProfileRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Container\Skills\ContProfileRetrieval::__construct ( protected SkillProfileService  $profile_service,
protected \ilSkillManagementSettings  $skmg_settings,
protected int  $cont_member_role_id 
)

Definition at line 33 of file ContProfileRetrieval.php.

37 {
38 }

Member Function Documentation

◆ count()

ILIAS\Container\Skills\ContProfileRetrieval::count ( array  $filter,
array  $parameters 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 80 of file ContProfileRetrieval.php.

83 : int {
84 $count = 0;
85
86 if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
87 $count += count($this->profile_service->getGlobalProfilesOfRole($this->cont_member_role_id));
88 }
89 if ($this->skmg_settings->getAllowLocalProfiles()) {
90 $count += count($this->profile_service->getLocalProfilesOfRole($this->cont_member_role_id));
91 }
92
93 return $count;
94 }
count(array $filter, array $parameters)

◆ getData()

ILIAS\Container\Skills\ContProfileRetrieval::getData ( array  $fields,
?Range  $range = null,
?Order  $order = null,
array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 40 of file ContProfileRetrieval.php.

46 : \Generator {
47 $profiles = [];
48
49 if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
50 foreach ($this->profile_service->getGlobalProfilesOfRole($this->cont_member_role_id) as $gp) {
51 $profiles[] = $gp;
52 }
53 }
54 if ($this->skmg_settings->getAllowLocalProfiles()) {
55 foreach ($this->profile_service->getLocalProfilesOfRole($this->cont_member_role_id) as $lp) {
56 $profiles[] = $lp;
57 }
58 }
59
60 // convert profiles to array structure, because tables can only handle arrays
61 $profiles_array = [];
62 foreach ($profiles as $profile) {
63 $profiles_array[$profile->getId()] = [
64 "id" => $profile->getId(),
65 "profile_id" => $profile->getId(),
66 "title" => $profile->getTitle(),
67 "profile_ref_id" => $profile->getRefId()
68 ];
69 }
70 ksort($profiles_array);
71
72 $profiles_array = $this->applyOrder($profiles_array, $order);
73 $profiles_array = $this->applyRange($profiles_array, $range);
74
75 foreach ($profiles_array as $profile) {
76 yield $profile;
77 }
78 }

◆ isFieldNumeric()

ILIAS\Container\Skills\ContProfileRetrieval::isFieldNumeric ( string  $field)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 96 of file ContProfileRetrieval.php.

96 : bool
97 {
98 return in_array($field, ["profile_id", "id"]);
99 }

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