ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\LearningModule\Editing\SubObjectRetrieval Class Reference
+ Inheritance diagram for ILIAS\LearningModule\Editing\SubObjectRetrieval:
+ Collaboration diagram for ILIAS\LearningModule\Editing\SubObjectRetrieval:

Public Member Functions

 __construct (protected \ilLMTree $lm_tree, protected $type="", protected $current_node=0, protected $transl="")
 
 getChildTitle (array $child)
 
 getData (array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
 
 count (array $filter=[], array $parameters=[])
 
 isFieldNumeric (string $field)
 

Protected Member Functions

 getChilds ()
 

Protected Attributes

ilLanguage $lng
 
ILIAS UI Factory $f
 
array $childs = null
 

Detailed Description

Definition at line 27 of file SubObjectRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LearningModule\Editing\SubObjectRetrieval::__construct ( protected \ilLMTree  $lm_tree,
protected  $type = "",
protected  $current_node = 0,
protected  $transl = "" 
)

Definition at line 33 of file SubObjectRetrieval.php.

References $DIC, and ILIAS\Repository\lng().

38  {
39  global $DIC;
40  $this->f = $DIC->ui()->factory();
41  $this->lng = $DIC->language();
42  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ count()

ILIAS\LearningModule\Editing\SubObjectRetrieval::count ( array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 110 of file SubObjectRetrieval.php.

References ILIAS\LearningModule\Editing\SubObjectRetrieval\getChilds().

113  : int {
114  return count($this->getChilds());
115  }
count(array $filter=[], array $parameters=[])
+ Here is the call graph for this function:

◆ getChilds()

ILIAS\LearningModule\Editing\SubObjectRetrieval::getChilds ( )
protected

Definition at line 53 of file SubObjectRetrieval.php.

References ILIAS\LearningModule\Editing\SubObjectRetrieval\$childs.

Referenced by ILIAS\LearningModule\Editing\SubObjectRetrieval\count(), and ILIAS\LearningModule\Editing\SubObjectRetrieval\getData().

53  : array
54  {
55  $current_node = ($this->current_node > 0)
56  ? $this->current_node
57  : $this->lm_tree->readRootId();
58  if (is_null($this->childs)) {
59  $this->childs = $this->lm_tree->getChildsByType($current_node, $this->type);
60  }
61  return $this->childs;
62  }
+ Here is the caller graph for this function:

◆ getChildTitle()

ILIAS\LearningModule\Editing\SubObjectRetrieval::getChildTitle ( array  $child)

Definition at line 44 of file SubObjectRetrieval.php.

Referenced by ILIAS\LearningModule\Editing\SubObjectRetrieval\getData().

44  : string
45  {
46  if (!in_array($this->transl, ["-", ""])) {
47  $lmobjtrans = new \ilLMObjTranslation($child["child"], $this->transl);
48  return $lmobjtrans->getTitle();
49  }
50  return $child["title"];
51  }
+ Here is the caller graph for this function:

◆ getData()

ILIAS\LearningModule\Editing\SubObjectRetrieval::getData ( array  $fields,
?Range  $range = null,
?Order  $order = null,
array  $filter = [],
array  $parameters = [] 
)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 64 of file SubObjectRetrieval.php.

References $lm_set, ilPageObject\_isScheduledActivation(), ilPageObject\_lookupActive(), ilPageObject\_lookupContainsDeactivatedElements(), ILIAS\LearningModule\Editing\SubObjectRetrieval\getChilds(), and ILIAS\LearningModule\Editing\SubObjectRetrieval\getChildTitle().

70  : \Generator {
71  foreach ($this->getChilds() as $child) {
72  $active = true;
73  $scheduled = false;
74  $deactivated_elements = false;
75  if ($child["type"] === "pg") {
76  // check activation
77  $lm_set = new \ilSetting("lm");
78  $active = \ilLMPage::_lookupActive(
79  $child["obj_id"],
80  "lm",
81  (bool) $lm_set->get("time_scheduled_page_activation")
82  );
83 
84  // is page scheduled?
85  $scheduled = ((bool) $lm_set->get("time_scheduled_page_activation") &&
86  \ilLMPage::_isScheduledActivation($child["obj_id"], "lm"));
87  if ($active) {
88  $deactivated_elements = (\ilLMPage::_lookupContainsDeactivatedElements(
89  $child["obj_id"],
90  "lm"
91  ));
92  }
93  }
94  $trans_title = "";
95  if (!in_array($this->transl, ["-", ""])) {
96  $trans_title = $this->getChildTitle($child);
97  }
98  yield [
99  "id" => $child["child"],
100  "deactivated_elements" => $deactivated_elements,
101  "active" => $active,
102  "scheduled" => $scheduled,
103  "type" => $child["type"],
104  "title" => $child["title"],
105  "trans_title" => $trans_title
106  ];
107  }
108  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static _isScheduledActivation(int $a_id, string $a_parent_type, string $a_lang="-")
Check whether page is activated by time schedule.
static _lookupContainsDeactivatedElements(int $a_id, string $a_parent_type, string $a_lang="-")
lookup whether page contains deactivated elements
$lm_set
+ Here is the call graph for this function:

◆ isFieldNumeric()

ILIAS\LearningModule\Editing\SubObjectRetrieval::isFieldNumeric ( string  $field)

Implements ILIAS\Repository\RetrievalInterface.

Definition at line 117 of file SubObjectRetrieval.php.

117  : bool
118  {
119  return $field === "id";
120  }

Field Documentation

◆ $childs

array ILIAS\LearningModule\Editing\SubObjectRetrieval::$childs = null
protected

◆ $f

ILIAS UI Factory ILIAS\LearningModule\Editing\SubObjectRetrieval::$f
protected

Definition at line 30 of file SubObjectRetrieval.php.

◆ $lng

ilLanguage ILIAS\LearningModule\Editing\SubObjectRetrieval::$lng
protected

Definition at line 29 of file SubObjectRetrieval.php.


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