ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
arBuilder Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for arBuilder:

Public Member Functions

 __construct (ActiveRecord $activeRecord, ?int $step=null)
 
 generateDBUpdateForInstallation ()
 
 setAr (\ActiveRecord $activeRecord)
 
 getAr ()
 
 setStep (int $step)
 
 getStep ()
 

Protected Attributes

ActiveRecord $ar
 
int $step = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class arBuilder

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
2.0.7

Definition at line 24 of file class.arBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

arBuilder::__construct ( ActiveRecord  $activeRecord,
?int  $step = null 
)

Definition at line 29 of file class.arBuilder.php.

30 {
31 $this->setAr($activeRecord);
32 $this->setStep($step ?? 0);
33 }
setAr(\ActiveRecord $activeRecord)
setStep(int $step)

References setAr(), and setStep().

+ Here is the call graph for this function:

Member Function Documentation

◆ generateDBUpdateForInstallation()

arBuilder::generateDBUpdateForInstallation ( )

Definition at line 35 of file class.arBuilder.php.

35 : void
36 {
37 $ilTemplate = new ilTemplate(__DIR__ . '/templates/dbupdate.txt', true, true);
38 $ar = $this->getAr();
39
40 $ilTemplate->setVariable('TABLE_NAME', $ar->getConnectorContainerName());
41 $ilTemplate->setVariable('TABLE_NAME2', $ar->getConnectorContainerName());
42 $ilTemplate->setVariable('TABLE_NAME3', $ar->getConnectorContainerName());
43 $ilTemplate->setVariable('STEP', $this->getStep());
44 $ilTemplate->setVariable('PRIMARY', $this->getAr()->getArFieldList()->getPrimaryFieldName());
45
46 foreach ($this->getAr()->getArFieldList()->getFields() as $arField) {
47 $ilTemplate->touchBlock('field');
48 $ilTemplate->setVariable('FIELD_NAME', $arField->getName());
49 foreach ($arField->getAttributesForConnector() as $name => $value) {
50 $ilTemplate->setCurrentBlock('attribute');
51 $ilTemplate->setVariable('NAME', arFieldList::mapKey($name));
52 $ilTemplate->setVariable('VALUE', $value);
53 $ilTemplate->parseCurrentBlock();
54 }
55 }
56
57 if ($this->getAr()->getArFieldList()->getPrimaryField()->getFieldType() === arField::FIELD_TYPE_INTEGER) {
58 $ilTemplate->setCurrentBlock('attribute');
59 $ilTemplate->setVariable('TABLE_NAME4', $ar->getConnectorContainerName());
60 $ilTemplate->parseCurrentBlock();
61 }
62
63 header('Content-type: application/x-httpd-php');
64 header("Content-Disposition: attachment; filename=\"dbupdate.php\"");
65 echo $ilTemplate->get();
66 exit;
67 }
getConnectorContainerName()
@description Return the Name of your Connector Table
ActiveRecord $ar
static mapKey(string $key)
const FIELD_TYPE_INTEGER
special template class to simplify handling of ITX/PEAR
exit

References $ar, exit, arField\FIELD_TYPE_INTEGER, getAr(), ActiveRecord\getConnectorContainerName(), getStep(), ILIAS\UI\examples\Symbol\Glyph\Header\header(), and arFieldList\mapKey().

+ Here is the call graph for this function:

◆ getAr()

arBuilder::getAr ( )

Definition at line 74 of file class.arBuilder.php.

75 {
76 return $this->ar;
77 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ar.

Referenced by generateDBUpdateForInstallation().

+ Here is the caller graph for this function:

◆ getStep()

arBuilder::getStep ( )

Definition at line 84 of file class.arBuilder.php.

84 : ?int
85 {
86 return $this->step;
87 }

References $step.

Referenced by generateDBUpdateForInstallation().

+ Here is the caller graph for this function:

◆ setAr()

arBuilder::setAr ( \ActiveRecord  $activeRecord)

Definition at line 69 of file class.arBuilder.php.

69 : void
70 {
71 $this->ar = $activeRecord;
72 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setStep()

arBuilder::setStep ( int  $step)

Definition at line 79 of file class.arBuilder.php.

79 : void
80 {
81 $this->step = $step;
82 }

References $step.

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $ar

ActiveRecord arBuilder::$ar
protected

Definition at line 26 of file class.arBuilder.php.

Referenced by generateDBUpdateForInstallation(), and getAr().

◆ $step

int arBuilder::$step = null
protected

Definition at line 27 of file class.arBuilder.php.

Referenced by getStep(), and setStep().


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