ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDataCollectionRecordListViewdefinition Class Reference

Class ilDataCollectionField. More...

+ Collaboration diagram for ilDataCollectionRecordListViewdefinition:

Public Member Functions

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

Protected Attributes

 $id
 $table_id
 $type
 $formtype
 $arr_fieldorder

Detailed Description

Constructor & Destructor Documentation

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

{
$this->type = 1; //Type list
$this->formtype = 1; //FieldOrder-Formular
if($a_table_id != 0)
{
$this->table_id = $a_table_id;
$this->doRead();
}
}

+ Here is the call graph for this function:

Member Function Documentation

ilDataCollectionRecordListViewdefinition::doCreate ( )

Create.

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

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

{
global $ilDB;
$ilDB->manipulate('DELETE FROM il_dcl_view
WHERE table_id = '.$ilDB->quote($this->getTableId(), "integer").'
AND type = '.$ilDB->quote($this->getType(), "integer").'
AND formtype = '.$ilDB->quote($this->getFormType(), "integer"));
$id = $ilDB->nextId("il_dcl_view");
$this->setId($id);
$query = "INSERT INTO il_dcl_view (".
"id".
", table_id".
", type".
", formtype".
" ) VALUES (".
$ilDB->quote($this->getId(), "integer")
.",".$ilDB->quote($this->getTableId(), "integer")
.",".$ilDB->quote($this->getType(), "integer")
.",".$ilDB->quote($this->getFormType(), "integer")
.")";
$ilDB->manipulate($query);
foreach($this->getArrFieldOrder() as $key => $order)
{
$viewdefinitionid = $ilDB->nextId("il_dcl_viewdefinition");
$query = "INSERT INTO il_dcl_viewdefinition (".
"id".
", view_id".
", field".
", field_order".
" ) VALUES (".
$ilDB->quote($viewdefinitionid, "integer")
.",".$ilDB->quote($this->getId(), "integer")
.",".$ilDB->quote($key, "text")
.",".$ilDB->quote($order, "integer")
.")";
$ilDB->manipulate($query);
}
}

+ Here is the call graph for this function:

ilDataCollectionRecordListViewdefinition::doRead ( )

Read.

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

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

Referenced by __construct().

{
global $ilDB;
$query = "SELECT il_dcl_viewdefinition.field field,
il_dcl_viewdefinition.field_order fieldorder,
CASE il_dcl_viewdefinition.field
WHEN il_dcl_field.id THEN il_dcl_field.title
ELSE il_dcl_viewdefinition.field
END title,
il_dcl_datatype.storage_location storage_location
FROM il_dcl_view
LEFT JOIN il_dcl_viewdefinition ON il_dcl_viewdefinition.view_id = il_dcl_view.id
LEFT JOIN il_dcl_field ON il_dcl_viewdefinition.field = il_dcl_field.id
LEFT JOIN il_dcl_datatype ON il_dcl_field.datatype_id = il_dcl_datatype.id
WHERE il_dcl_view.table_id = ".$ilDB->quote($this->getTableId(),"integer")."
AND il_dcl_view.type = ".$ilDB->quote($this->getType(),"integer")."
AND il_dcl_view.formtype = ".$ilDB->quote($this->getFormType(),"integer")."
ORDER by il_dcl_viewdefinition.field_order";
$set = $ilDB->query($query);
$all = array();
while($rec = $ilDB->fetchAssoc($set))
{
$this->setArrFieldOrder($rec['fieldorder'], $rec['field']);
$this->setTabledefinition($rec['title'], $rec['field']);
if($rec['storage_location'])
{
$this->setRecordfield($rec['storage_location'],$rec['field']);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionRecordListViewdefinition::getArrFieldOrder ( )

Get field order.

Returns
array

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

Referenced by doCreate().

{
return $this->arrfieldorder;
}

+ Here is the caller graph for this function:

ilDataCollectionRecordListViewdefinition::getArrRecordfield ( )

Get table definition.

Returns
array

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

{
return $this->arrrecordfield;
}
ilDataCollectionRecordListViewdefinition::getArrTabledefinition ( )

Get table definition.

Returns
array

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

{
return $this->arrtabledefinition;
}
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:

ilDataCollectionRecordListViewdefinition::getId ( )

Get id.

Returns
int

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

References $id.

Referenced by doCreate().

{
return $this->id;
}

+ Here is the caller graph for this function:

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:

ilDataCollectionRecordListViewdefinition::getType ( )

Get type.

Returns
int

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

References $type.

Referenced by doCreate(), and doRead().

{
return $this->type;
}

+ Here is the caller graph for this function:

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

{
$this->arrfieldorder[$a_key] = $a_order;
}

+ Here is the caller graph for this function:

ilDataCollectionRecordListViewdefinition::setFormType (   $a_formtype)

Set formtype.

Parameters
int$a_formtype

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

{
$this->formtype = $a_formtype;
}
ilDataCollectionRecordListViewdefinition::setId (   $a_id)

Set id.

Parameters
int$a_id

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

Referenced by doCreate().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

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

{
$this->arrrecordfield[$a_key]['id'] = $a_key;
$this->arrrecordfield[$a_key]['storage_location'] = $storage_location;
}

+ Here is the caller graph for this function:

ilDataCollectionRecordListViewdefinition::setTabledefinition (   $title,
  $a_key 
)

Set table definition.

Parameters
string$title
string$a_key

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

References $title.

Referenced by doRead().

{
$this->arrtabledefinition[$a_key]['title'] = $title;
}

+ Here is the caller graph for this function:

ilDataCollectionRecordListViewdefinition::setTableId (   $a_id)

Set table ID.

Parameters
int$a_id

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

{
$this->table_id = $a_id;
}
ilDataCollectionRecordListViewdefinition::setType (   $a_type)

Set type.

Parameters
int$a_type

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

{
$this->type = $a_type;
}

Field Documentation

ilDataCollectionRecordListViewdefinition::$arr_fieldorder
protected
ilDataCollectionRecordListViewdefinition::$formtype
protected

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

Referenced by getFormType().

ilDataCollectionRecordListViewdefinition::$id
protected

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

Referenced by doCreate(), and getId().

ilDataCollectionRecordListViewdefinition::$table_id
protected

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

Referenced by getTableId().

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: