ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDataCollectionRecordListViewdefinition Class Reference

Class ilDataCollectionField. More...

+ Collaboration diagram for ilDataCollectionRecordListViewdefinition:

Public Member Functions

 __construct ($a_table_id)
 Constructor public. More...
 
 setId ($a_id)
 Set id. More...
 
 getId ()
 Get id. More...
 
 setTableId ($a_id)
 Set table ID. More...
 
 getTableId ()
 Get table ID. More...
 
 setType ($a_type)
 Set type. More...
 
 getType ()
 Get type. More...
 
 setFormType ($a_formtype)
 Set formtype. More...
 
 getFormType ()
 Get formtype. More...
 
 setArrFieldOrder ($a_order, $a_key)
 Set field order. More...
 
 getArrFieldOrder ()
 Get field order. More...
 
 setTabledefinition ($title, $a_key)
 Set table definition. More...
 
 getArrTabledefinition ()
 Get table definition. More...
 
 setRecordfield ($storage_location, $a_key)
 Set record fields. More...
 
 getArrRecordfield ()
 Get table definition. More...
 
 doRead ()
 Read. More...
 
 doCreate ()
 Create. More...
 

Protected Attributes

 $id
 
 $table_id
 
 $type
 
 $formtype
 
 $arr_fieldorder
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDataCollectionRecordListViewdefinition::__construct (   $a_table_id)

Constructor public.

Parameters
integertable_id

At the moment we have one view per table. If we will have more than one view, we should work additional with the view_id

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

References doRead().

35  {
36  $this->type = 1; //Type list
37  $this->formtype = 1; //FieldOrder-Formular
38 
39  if($a_table_id != 0)
40  {
41  $this->table_id = $a_table_id;
42  $this->doRead();
43  }
44  }
+ Here is the call graph for this function:

Member Function Documentation

◆ doCreate()

ilDataCollectionRecordListViewdefinition::doCreate ( )

Create.

Definition at line 236 of file class.ilDataCollectionRecordListViewdefinition.php.

References $id, $ilDB, $query, getArrFieldOrder(), getFormType(), getId(), getTableId(), getType(), and setId().

237  {
238  global $ilDB;
239 
240  $ilDB->manipulate('DELETE FROM il_dcl_view
241  WHERE table_id = '.$ilDB->quote($this->getTableId(), "integer").'
242  AND type = '.$ilDB->quote($this->getType(), "integer").'
243  AND formtype = '.$ilDB->quote($this->getFormType(), "integer"));
244 
245  $id = $ilDB->nextId("il_dcl_view");
246  $this->setId($id);
247  $query = "INSERT INTO il_dcl_view (".
248  "id".
249  ", table_id".
250  ", type".
251  ", formtype".
252  " ) VALUES (".
253  $ilDB->quote($this->getId(), "integer")
254  .",".$ilDB->quote($this->getTableId(), "integer")
255  .",".$ilDB->quote($this->getType(), "integer")
256  .",".$ilDB->quote($this->getFormType(), "integer")
257  .")";
258  $ilDB->manipulate($query);
259 
260  foreach($this->getArrFieldOrder() as $key => $order)
261  {
262  $viewdefinitionid = $ilDB->nextId("il_dcl_viewdefinition");
263 
264  $query = "INSERT INTO il_dcl_viewdefinition (".
265  "id".
266  ", view_id".
267  ", field".
268  ", field_order".
269  " ) VALUES (".
270  $ilDB->quote($viewdefinitionid, "integer")
271  .",".$ilDB->quote($this->getId(), "integer")
272  .",".$ilDB->quote($key, "text")
273  .",".$ilDB->quote($order, "integer")
274  .")";
275  $ilDB->manipulate($query);
276  }
277  }
global $ilDB
+ Here is the call graph for this function:

◆ doRead()

ilDataCollectionRecordListViewdefinition::doRead ( )

Read.

Definition at line 195 of file class.ilDataCollectionRecordListViewdefinition.php.

References $ilDB, $query, getFormType(), getTableId(), getType(), setArrFieldOrder(), setRecordfield(), and setTabledefinition().

Referenced by __construct().

196  {
197  global $ilDB;
198 
199  $query = "SELECT il_dcl_viewdefinition.field field,
200  il_dcl_viewdefinition.field_order fieldorder,
201  CASE il_dcl_viewdefinition.field
202  WHEN il_dcl_field.id THEN il_dcl_field.title
203  ELSE il_dcl_viewdefinition.field
204  END title,
205  il_dcl_datatype.storage_location storage_location
206  FROM il_dcl_view
207  LEFT JOIN il_dcl_viewdefinition ON il_dcl_viewdefinition.view_id = il_dcl_view.id
208  LEFT JOIN il_dcl_field ON il_dcl_viewdefinition.field = il_dcl_field.id
209  LEFT JOIN il_dcl_datatype ON il_dcl_field.datatype_id = il_dcl_datatype.id
210  WHERE il_dcl_view.table_id = ".$ilDB->quote($this->getTableId(),"integer")."
211  AND il_dcl_view.type = ".$ilDB->quote($this->getType(),"integer")."
212  AND il_dcl_view.formtype = ".$ilDB->quote($this->getFormType(),"integer")."
213  ORDER by il_dcl_viewdefinition.field_order";
214 
215 
216  $set = $ilDB->query($query);
217 
218  $all = array();
219  while($rec = $ilDB->fetchAssoc($set))
220  {
221  $this->setArrFieldOrder($rec['fieldorder'], $rec['field']);
222 
223  $this->setTabledefinition($rec['title'], $rec['field']);
224  if($rec['storage_location'])
225  {
226  $this->setRecordfield($rec['storage_location'],$rec['field']);
227  }
228  }
229  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getArrFieldOrder()

ilDataCollectionRecordListViewdefinition::getArrFieldOrder ( )

Get field order.

Returns
array

Definition at line 143 of file class.ilDataCollectionRecordListViewdefinition.php.

Referenced by doCreate().

144  {
145  return $this->arrfieldorder;
146  }
+ Here is the caller graph for this function:

◆ getArrRecordfield()

ilDataCollectionRecordListViewdefinition::getArrRecordfield ( )

Get table definition.

Returns
array

Definition at line 187 of file class.ilDataCollectionRecordListViewdefinition.php.

188  {
189  return $this->arrrecordfield;
190  }

◆ getArrTabledefinition()

ilDataCollectionRecordListViewdefinition::getArrTabledefinition ( )

Get table definition.

Returns
array

Definition at line 165 of file class.ilDataCollectionRecordListViewdefinition.php.

166  {
167  return $this->arrtabledefinition;
168  }

◆ getFormType()

ilDataCollectionRecordListViewdefinition::getFormType ( )

Get formtype.

Returns
int

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

References $formtype.

Referenced by doCreate(), and doRead().

+ Here is the caller graph for this function:

◆ getId()

ilDataCollectionRecordListViewdefinition::getId ( )

Get id.

Returns
int

Definition at line 61 of file class.ilDataCollectionRecordListViewdefinition.php.

References $id.

Referenced by doCreate().

+ Here is the caller graph for this function:

◆ getTableId()

ilDataCollectionRecordListViewdefinition::getTableId ( )

Get table ID.

Returns
int

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

References $table_id.

Referenced by doCreate(), and doRead().

+ Here is the caller graph for this function:

◆ getType()

ilDataCollectionRecordListViewdefinition::getType ( )

Get type.

Returns
int

Definition at line 101 of file class.ilDataCollectionRecordListViewdefinition.php.

References $type.

Referenced by doCreate(), and doRead().

+ Here is the caller graph for this function:

◆ setArrFieldOrder()

ilDataCollectionRecordListViewdefinition::setArrFieldOrder (   $a_order,
  $a_key 
)

Set field order.

Parameters
string$a_order
string$a_key

Definition at line 133 of file class.ilDataCollectionRecordListViewdefinition.php.

Referenced by doRead().

134  {
135  $this->arrfieldorder[$a_key] = $a_order;
136  }
+ Here is the caller graph for this function:

◆ setFormType()

ilDataCollectionRecordListViewdefinition::setFormType (   $a_formtype)

Set formtype.

Parameters
int$a_formtype

Definition at line 111 of file class.ilDataCollectionRecordListViewdefinition.php.

112  {
113  $this->formtype = $a_formtype;
114  }

◆ setId()

ilDataCollectionRecordListViewdefinition::setId (   $a_id)

Set id.

Parameters
int$a_id

Definition at line 51 of file class.ilDataCollectionRecordListViewdefinition.php.

Referenced by doCreate().

52  {
53  $this->id = $a_id;
54  }
+ Here is the caller graph for this function:

◆ setRecordfield()

ilDataCollectionRecordListViewdefinition::setRecordfield (   $storage_location,
  $a_key 
)

Set record fields.

Parameters
string$storage_location
string$a_key

Definition at line 176 of file class.ilDataCollectionRecordListViewdefinition.php.

Referenced by doRead().

177  {
178  $this->arrrecordfield[$a_key]['id'] = $a_key;
179  $this->arrrecordfield[$a_key]['storage_location'] = $storage_location;
180  }
+ Here is the caller graph for this function:

◆ setTabledefinition()

ilDataCollectionRecordListViewdefinition::setTabledefinition (   $title,
  $a_key 
)

Set table definition.

Parameters
string$title
string$a_key

Definition at line 155 of file class.ilDataCollectionRecordListViewdefinition.php.

Referenced by doRead().

156  {
157  $this->arrtabledefinition[$a_key]['title'] = $title;
158  }
+ Here is the caller graph for this function:

◆ setTableId()

ilDataCollectionRecordListViewdefinition::setTableId (   $a_id)

Set table ID.

Parameters
int$a_id

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

72  {
73  $this->table_id = $a_id;
74  }

◆ setType()

ilDataCollectionRecordListViewdefinition::setType (   $a_type)

Set type.

Parameters
int$a_type

Definition at line 91 of file class.ilDataCollectionRecordListViewdefinition.php.

92  {
93  $this->type = $a_type;
94  }

Field Documentation

◆ $arr_fieldorder

ilDataCollectionRecordListViewdefinition::$arr_fieldorder
protected

◆ $formtype

ilDataCollectionRecordListViewdefinition::$formtype
protected

Definition at line 21 of file class.ilDataCollectionRecordListViewdefinition.php.

Referenced by getFormType().

◆ $id

ilDataCollectionRecordListViewdefinition::$id
protected

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

Referenced by doCreate(), and getId().

◆ $table_id

ilDataCollectionRecordListViewdefinition::$table_id
protected

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

Referenced by getTableId().

◆ $type

ilDataCollectionRecordListViewdefinition::$type
protected

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

Referenced by getType().


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