ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
arBuilder Class Reference

Class arBuilder. More...

+ Collaboration diagram for arBuilder:

Public Member Functions

 __construct (ActiveRecord $ar, $step=1)
 
 generateDBUpdateForInstallation ()
 
 setAr ($ar)
 
 getAr ()
 
 setStep ($step)
 
 getStep ()
 

Protected Attributes

 $ar
 
 $step
 

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $step, setAr(), and setStep().

26  {
27  $this->setAr($ar);
28  $this->setStep($step);
29  }
setStep($step)
+ Here is the call graph for this function:

Member Function Documentation

◆ generateDBUpdateForInstallation()

arBuilder::generateDBUpdateForInstallation ( )

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

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

32  {
33  $tpl = new ilTemplate(dirname(__FILE__) . '/templates/dbupdate.txt', true, true);
34  $ar = $this->getAr();
35 
36  $tpl->setVariable('TABLE_NAME', $ar->getConnectorContainerName());
37  $tpl->setVariable('TABLE_NAME2', $ar->getConnectorContainerName());
38  $tpl->setVariable('TABLE_NAME3', $ar->getConnectorContainerName());
39  $tpl->setVariable('STEP', $this->getStep());
40  $tpl->setVariable('PRIMARY', $this->getAr()->getArFieldList()->getPrimaryFieldName());
41 
42  foreach ($this->getAr()->getArFieldList()->getFields() as $field) {
43  $tpl->touchBlock('field');
44  $tpl->setVariable('FIELD_NAME', $field->getName());
45  foreach ($field->getAttributesForConnector() as $name => $value) {
46  $tpl->setCurrentBlock('attribute');
47  $tpl->setVariable('NAME', arFieldList::mapKey($name));
48  $tpl->setVariable('VALUE', $value);
49  $tpl->parseCurrentBlock();
50  }
51  }
52 
53  if ($this->getAr()->getArFieldList()->getPrimaryField()->getFieldType() == arField::FIELD_TYPE_INTEGER) {
54  $tpl->setCurrentBlock('attribute');
55  $tpl->setVariable('TABLE_NAME4', $ar->getConnectorContainerName());
56  $tpl->parseCurrentBlock();
57  }
58 
59  header('Content-type: application/x-httpd-php');
60  header("Content-Disposition: attachment; filename=\"dbupdate.php\"");
61  echo $tpl->get();
62  exit;
63  }
static mapKey($key)
global $tpl
Definition: ilias.php:8
const FIELD_TYPE_INTEGER
special template class to simplify handling of ITX/PEAR
Add a drawing to the header
Definition: 04printing.php:69
+ Here is the call graph for this function:

◆ getAr()

arBuilder::getAr ( )
Returns

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

References $ar.

Referenced by generateDBUpdateForInstallation().

77  {
78  return $this->ar;
79  }
+ Here is the caller graph for this function:

◆ getStep()

arBuilder::getStep ( )
Returns
int

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

References $step.

Referenced by generateDBUpdateForInstallation().

93  {
94  return $this->step;
95  }
+ Here is the caller graph for this function:

◆ setAr()

arBuilder::setAr (   $ar)
Parameters
\ActiveRecord$ar

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

References $ar.

Referenced by __construct().

69  {
70  $this->ar = $ar;
71  }
+ Here is the caller graph for this function:

◆ setStep()

arBuilder::setStep (   $step)
Parameters
int$step

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

References $step.

Referenced by __construct().

85  {
86  $this->step = $step;
87  }
+ Here is the caller graph for this function:

Field Documentation

◆ $ar

arBuilder::$ar
protected

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

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

◆ $step

arBuilder::$step
protected

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

Referenced by __construct(), getStep(), and setStep().


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