3 declare(strict_types=1);
11 if (is_array($this->elements)) {
12 foreach ($this->elements as
$id => $element) {
13 $this->elements[
$id] = clone $element;
25 parent::setDefinition($a_def);
27 $this->elements = array();
39 if (is_array($elements)) {
40 foreach ($elements as $element) {
53 return array_key_exists($a_name, $this->elements);
59 return $this->elements[$a_name];
104 return array_keys($this->validation_errors);
109 $this->validation_errors[$a_error_code] = $a_element_id;
114 $valid = parent::isValid();
116 foreach ($this->
getElements() as $element_id => $element) {
117 if (!$element->isValid()) {
118 foreach ($element->getValidationErrors() as $error) {
133 if (isset($this->validation_errors[$a_code])) {
134 $element_id = $this->validation_errors[$a_code];
137 return $element->translateErrorCode($a_code);
140 return parent::translateErrorCode($a_code);
148 $tmp[] = $element->getCheckSum();
150 return md5(implode(
",", $tmp));
159 $obj->$id = $element->exportStdClass();
166 if (is_object($a_std)) {
168 $element->importStdClass($a_std->$id);
hasElement(string $a_name)
getValidationErrorsByElements()
isValidDefinition(ilADTDefinition $a_def)
addElementValidationError(string $a_element_id, string $a_error_code)
importStdClass(?stdClass $a_std)
translateErrorCode(string $a_code)
addElement(string $a_name, ilADTDefinition $a_def)
getCheckSum()
Get unique checksum.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
setDefinition(ilADTDefinition $a_def)
ADT definition base class.
getElement(string $a_name)
getDefinition()
Get definition.