ILIAS  release_8 Revision v8.24
arBuilder Class Reference

Class arBuilder. More...

+ Collaboration diagram for arBuilder:

Public Member Functions

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

Protected Attributes

ActiveRecord $ar
 
int $step = null
 

Detailed Description

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 21 of file class.arBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

27 {
28 $this->setAr($ar);
29 $this->setStep($step ?? 0);
30 }
setStep(int $step)
setAr(\ActiveRecord $ar)

References setAr(), and setStep().

+ Here is the call graph for this function:

Member Function Documentation

◆ generateDBUpdateForInstallation()

arBuilder::generateDBUpdateForInstallation ( )

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

32 : void
33 {
34 $tpl = new ilTemplate(__DIR__ . '/templates/dbupdate.txt', true, true);
35 $ar = $this->getAr();
36
37 $tpl->setVariable('TABLE_NAME', $ar->getConnectorContainerName());
38 $tpl->setVariable('TABLE_NAME2', $ar->getConnectorContainerName());
39 $tpl->setVariable('TABLE_NAME3', $ar->getConnectorContainerName());
40 $tpl->setVariable('STEP', $this->getStep());
41 $tpl->setVariable('PRIMARY', $this->getAr()->getArFieldList()->getPrimaryFieldName());
42
43 foreach ($this->getAr()->getArFieldList()->getFields() as $field) {
44 $tpl->touchBlock('field');
45 $tpl->setVariable('FIELD_NAME', $field->getName());
46 foreach ($field->getAttributesForConnector() as $name => $value) {
47 $tpl->setCurrentBlock('attribute');
48 $tpl->setVariable('NAME', arFieldList::mapKey($name));
49 $tpl->setVariable('VALUE', $value);
50 $tpl->parseCurrentBlock();
51 }
52 }
53
54 if ($this->getAr()->getArFieldList()->getPrimaryField()->getFieldType() === arField::FIELD_TYPE_INTEGER) {
55 $tpl->setCurrentBlock('attribute');
56 $tpl->setVariable('TABLE_NAME4', $ar->getConnectorContainerName());
57 $tpl->parseCurrentBlock();
58 }
59
60 header('Content-type: application/x-httpd-php');
61 header("Content-Disposition: attachment; filename=\"dbupdate.php\"");
62 echo $tpl->get();
63 exit;
64 }
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
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
exit
Definition: login.php:28
if($format !==null) $name
Definition: metadata.php:247

References $ar, $name, $tpl, exit, arField\FIELD_TYPE_INTEGER, getAr(), ActiveRecord\getConnectorContainerName(), getStep(), and arFieldList\mapKey().

+ Here is the call graph for this function:

◆ getAr()

arBuilder::getAr ( )

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

72 {
73 return $this->ar;
74 }
Class ActiveRecord.

References $ar.

Referenced by generateDBUpdateForInstallation().

+ Here is the caller graph for this function:

◆ getStep()

arBuilder::getStep ( )

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

81 : int
82 {
83 return $this->step;
84 }

References $step.

Referenced by generateDBUpdateForInstallation().

+ Here is the caller graph for this function:

◆ setAr()

arBuilder::setAr ( \ActiveRecord  $ar)

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

66 : void
67 {
68 $this->ar = $ar;
69 }

References $ar.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setStep()

arBuilder::setStep ( int  $step)

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

76 : void
77 {
78 $this->step = $step;
79 }

References $step.

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $ar

ActiveRecord arBuilder::$ar
protected

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

Referenced by generateDBUpdateForInstallation(), getAr(), and setAr().

◆ $step

int arBuilder::$step = null
protected

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

Referenced by getStep(), and setStep().


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