ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
assFormulaQuestionUnit Class Reference

Formula Question Unit. More...

+ Collaboration diagram for assFormulaQuestionUnit:

Public Member Functions

 __construct ()
 
 initFormArray (array $data)
 
 setBaseunitTitle ($baseunit_title)
 
 getBaseunitTitle ()
 
 setId ($id)
 
 getId ()
 
 setUnit ($unit)
 
 getUnit ()
 
 setSequence ($sequence)
 
 getSequence ()
 
 setFactor ($factor)
 
 getFactor ()
 
 setBaseUnit ($baseunit)
 
 getBaseUnit ()
 
 setCategory ($category)
 
 getCategory ()
 

Static Public Member Functions

static lookupUnitFactor ($a_unit_id)
 

Private Attributes

 $unit = ''
 
 $factor = 0.0
 
 $baseunit = 0
 
 $baseunit_title = ''
 
 $id = 0
 
 $category = 0
 
 $sequence = 0
 

Detailed Description

Formula Question Unit.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Version
Id
class.assFormulaQuestionUnit.php 404 2009-04-27 04:56:49Z hschottm

Definition at line 11 of file class.assFormulaQuestionUnit.php.

Constructor & Destructor Documentation

◆ __construct()

assFormulaQuestionUnit::__construct ( )

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

25  {
26  }

Member Function Documentation

◆ getBaseUnit()

assFormulaQuestionUnit::getBaseUnit ( )

Definition at line 107 of file class.assFormulaQuestionUnit.php.

References $baseunit, and $id.

Referenced by ilUnitConfigurationRepository\checkDeleteUnit().

108  {
109  if (is_numeric($this->baseunit) && $this->baseunit > 0) {
110  return $this->baseunit;
111  } else {
112  return $this->id;
113  }
114  }
+ Here is the caller graph for this function:

◆ getBaseunitTitle()

assFormulaQuestionUnit::getBaseunitTitle ( )
Returns
string

Definition at line 53 of file class.assFormulaQuestionUnit.php.

References $baseunit_title.

◆ getCategory()

assFormulaQuestionUnit::getCategory ( )

Definition at line 121 of file class.assFormulaQuestionUnit.php.

References $category, $DIC, $lng, $unit, and getUnit().

Referenced by ilUnitConfigurationRepository\checkDeleteUnit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFactor()

assFormulaQuestionUnit::getFactor ( )

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

References $factor.

Referenced by ilUnitConfigurationRepository\checkDeleteUnit().

+ Here is the caller graph for this function:

◆ getId()

assFormulaQuestionUnit::getId ( )

Definition at line 63 of file class.assFormulaQuestionUnit.php.

References $id.

Referenced by ilUnitConfigurationRepository\checkDeleteUnit(), and ilUnitConfigurationGUI\showUnitCreationForm().

+ Here is the caller graph for this function:

◆ getSequence()

assFormulaQuestionUnit::getSequence ( )

Definition at line 83 of file class.assFormulaQuestionUnit.php.

References $sequence.

Referenced by ilUnitConfigurationRepository\checkDeleteUnit().

+ Here is the caller graph for this function:

◆ getUnit()

assFormulaQuestionUnit::getUnit ( )

Definition at line 73 of file class.assFormulaQuestionUnit.php.

References $unit.

Referenced by ilUnitConfigurationRepository\checkDeleteUnit(), and getCategory().

+ Here is the caller graph for this function:

◆ initFormArray()

assFormulaQuestionUnit::initFormArray ( array  $data)
Parameters
array$data

Definition at line 31 of file class.assFormulaQuestionUnit.php.

32  {
33  $this->id = $data['unit_id'];
34  $this->unit = $data['unit'];
35  $this->factor = $data['factor'];
36  $this->baseunit = $data['baseunit_fi'];
37  $this->baseunit_title = $data['baseunit_title'];
38  $this->category = $data['category'];
39  $this->sequence = $data['sequence'];
40  }
$data
Definition: bench.php:6

◆ lookupUnitFactor()

static assFormulaQuestionUnit::lookupUnitFactor (   $a_unit_id)
static
Parameters
integer$a_unit_id
Returns
mixed

Definition at line 145 of file class.assFormulaQuestionUnit.php.

References $DIC, $ilDB, $res, and $row.

Referenced by assFormulaQuestion\getBestSolution().

146  {
147  global $DIC;
148  $ilDB = $DIC['ilDB'];
149 
150  $res = $ilDB->queryF(
151  'SELECT factor FROM il_qpl_qst_fq_unit WHERE unit_id = %s',
152  array('integer'),
153  array($a_unit_id)
154  );
155 
156  $row = $ilDB->fetchAssoc($res);
157 
158  return $row['factor'];
159  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$row
global $ilDB
+ Here is the caller graph for this function:

◆ setBaseUnit()

assFormulaQuestionUnit::setBaseUnit (   $baseunit)

Definition at line 98 of file class.assFormulaQuestionUnit.php.

References $baseunit.

Referenced by ilUnitConfigurationRepository\checkDeleteUnit().

99  {
100  if (is_numeric($baseunit) && $baseunit > 0) {
101  $this->baseunit = $baseunit;
102  } else {
103  $this->baseunit = null;
104  }
105  }
+ Here is the caller graph for this function:

◆ setBaseunitTitle()

assFormulaQuestionUnit::setBaseunitTitle (   $baseunit_title)
Parameters
string$baseunit_title

Definition at line 45 of file class.assFormulaQuestionUnit.php.

References $baseunit_title.

46  {
47  $this->baseunit_title = $baseunit_title;
48  }

◆ setCategory()

assFormulaQuestionUnit::setCategory (   $category)

Definition at line 116 of file class.assFormulaQuestionUnit.php.

References $category.

117  {
118  $this->category = $category;
119  }

◆ setFactor()

assFormulaQuestionUnit::setFactor (   $factor)

Definition at line 88 of file class.assFormulaQuestionUnit.php.

References $factor.

Referenced by ilUnitConfigurationRepository\checkDeleteUnit().

89  {
90  $this->factor = $factor;
91  }
+ Here is the caller graph for this function:

◆ setId()

assFormulaQuestionUnit::setId (   $id)

Definition at line 58 of file class.assFormulaQuestionUnit.php.

References $id.

Referenced by ilUnitConfigurationRepository\checkDeleteUnit().

59  {
60  $this->id = $id;
61  }
+ Here is the caller graph for this function:

◆ setSequence()

assFormulaQuestionUnit::setSequence (   $sequence)

Definition at line 78 of file class.assFormulaQuestionUnit.php.

References $sequence.

Referenced by ilUnitConfigurationRepository\checkDeleteUnit().

79  {
80  $this->sequence = $sequence;
81  }
+ Here is the caller graph for this function:

◆ setUnit()

assFormulaQuestionUnit::setUnit (   $unit)

Definition at line 68 of file class.assFormulaQuestionUnit.php.

References $unit.

69  {
70  $this->unit = $unit;
71  }

Field Documentation

◆ $baseunit

assFormulaQuestionUnit::$baseunit = 0
private

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

Referenced by getBaseUnit(), and setBaseUnit().

◆ $baseunit_title

assFormulaQuestionUnit::$baseunit_title = ''
private

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

Referenced by getBaseunitTitle(), and setBaseunitTitle().

◆ $category

assFormulaQuestionUnit::$category = 0
private

Definition at line 18 of file class.assFormulaQuestionUnit.php.

Referenced by getCategory(), and setCategory().

◆ $factor

assFormulaQuestionUnit::$factor = 0.0
private

Definition at line 14 of file class.assFormulaQuestionUnit.php.

Referenced by getFactor(), and setFactor().

◆ $id

assFormulaQuestionUnit::$id = 0
private

Definition at line 17 of file class.assFormulaQuestionUnit.php.

Referenced by getBaseUnit(), getId(), and setId().

◆ $sequence

assFormulaQuestionUnit::$sequence = 0
private

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

Referenced by getSequence(), and setSequence().

◆ $unit

assFormulaQuestionUnit::$unit = ''
private

Definition at line 13 of file class.assFormulaQuestionUnit.php.

Referenced by getCategory(), getUnit(), and setUnit().


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