ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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

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().

{
$this->setAr($ar);
$this->setStep($step);
}

+ Here is the call graph for this function:

Member Function Documentation

arBuilder::generateDBUpdateForInstallation ( )

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

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

{
$tpl = new ilTemplate(dirname(__FILE__) . '/templates/dbupdate.txt', true, true);
$ar = $this->getAr();
$tpl->setVariable('TABLE_NAME', $ar->getConnectorContainerName());
$tpl->setVariable('TABLE_NAME2', $ar->getConnectorContainerName());
$tpl->setVariable('TABLE_NAME3', $ar->getConnectorContainerName());
$tpl->setVariable('STEP', $this->getStep());
$tpl->setVariable('PRIMARY', $this->getAr()->getArFieldList()->getPrimaryFieldName());
foreach ($this->getAr()->getArFieldList()->getFields() as $field) {
$tpl->touchBlock('field');
$tpl->setVariable('FIELD_NAME', $field->getName());
foreach ($field->getAttributesForConnector() as $name => $value) {
$tpl->setCurrentBlock('attribute');
$tpl->setVariable('NAME', arFieldList::mapKey($name));
$tpl->setVariable('VALUE', $value);
$tpl->parseCurrentBlock();
}
}
if ($this->getAr()->getArFieldList()->getPrimaryField()->getFieldType() == arField::FIELD_TYPE_INTEGER) {
$tpl->setCurrentBlock('attribute');
$tpl->setVariable('TABLE_NAME4', $ar->getConnectorContainerName());
$tpl->parseCurrentBlock();
}
header('Content-type: application/x-httpd-php');
header("Content-Disposition: attachment; filename=\"dbupdate.php\"");
echo $tpl->get();
}

+ Here is the call graph for this function:

arBuilder::getAr ( )
Returns

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

References $ar.

Referenced by generateDBUpdateForInstallation().

{
return $this->ar;
}

+ Here is the caller graph for this function:

arBuilder::getStep ( )
Returns
int

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

References $step.

Referenced by generateDBUpdateForInstallation().

{
return $this->step;
}

+ Here is the caller graph for this function:

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

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

References $ar.

Referenced by __construct().

{
$this->ar = $ar;
}

+ Here is the caller graph for this function:

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

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

References $step.

Referenced by __construct().

{
$this->step = $step;
}

+ Here is the caller graph for this function:

Field Documentation

arBuilder::$ar
protected

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

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

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: