ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 27 of file class.arBuilder.php.

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

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

Member Function Documentation

◆ generateDBUpdateForInstallation()

arBuilder::generateDBUpdateForInstallation ( )

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

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

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

◆ getAr()

arBuilder::getAr ( )
Returns

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

References $ar.

Referenced by generateDBUpdateForInstallation().

82  {
83  return $this->ar;
84  }
+ Here is the caller graph for this function:

◆ getStep()

arBuilder::getStep ( )
Returns
int

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

References $step.

Referenced by generateDBUpdateForInstallation().

100  {
101  return $this->step;
102  }
+ Here is the caller graph for this function:

◆ setAr()

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

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

References $ar.

Referenced by __construct().

73  {
74  $this->ar = $ar;
75  }
+ Here is the caller graph for this function:

◆ setStep()

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

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

References $step.

Referenced by __construct().

91  {
92  $this->step = $step;
93  }
+ Here is the caller graph for this function:

Field Documentation

◆ $ar

arBuilder::$ar
protected

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

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

◆ $step

arBuilder::$step
protected

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

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


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