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

Class ilDataCollectionField. More...

+ Inheritance diagram for ilDataCollectionRecordField:
+ Collaboration diagram for ilDataCollectionRecordField:

Public Member Functions

 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 doUpdate ()
 delete ()
 getValue ()
 setValue ($value)
 getFormInput ()
 getExportValue ()
 getPlainText ()
 getHTML ()
 getSingleHTML ($link=null)
 this funciton is used to in the viewdefinition of a single record.
 getField ()
 getId ()
 getRecord ()

Protected Member Functions

 loadValue ()

Protected Attributes

 $id
 $field
 $record
 $value

Private Member Functions

 doRead ()
 doCreate ()

Detailed Description

Constructor & Destructor Documentation

ilDataCollectionRecordField::__construct ( ilDataCollectionRecord  $record,
ilDataCollectionField  $field 
)

Reimplemented in ilDataCollectionILIASRefField, ilDataCollectionRatingField, and ilDataCollectionReferenceField.

Definition at line 30 of file class.ilDataCollectionRecordField.php.

References $field, $record, and doRead().

{
$this->record = $record;
$this->field = $field;
$this->doRead();
}

+ Here is the call graph for this function:

Member Function Documentation

ilDataCollectionRecordField::delete ( )

Reimplemented in ilDataCollectionRatingField.

Definition at line 92 of file class.ilDataCollectionRecordField.php.

References $query.

{
global $ilDB;
$datatype = $this->field->getDatatype();
$query = "DELETE FROM il_dcl_stloc".$datatype->getStorageLocation()."_value WHERE record_field_id = ".$ilDB->quote($this->id, "integer");
$ilDB->manipulate($query);
$query2 = "DELETE FROM il_dcl_record_field WHERE id = ".$ilDB->quote($this->id, "integer");
$ilDB->manipulate($query2);
}
ilDataCollectionRecordField::doCreate ( )
private

Definition at line 59 of file class.ilDataCollectionRecordField.php.

References $id, and $query.

Referenced by doRead().

{
global $ilDB;
$id = $ilDB->nextId("il_dcl_record_field");
$query = "INSERT INTO il_dcl_record_field (id, record_id, field_id) VALUES (".$ilDB->quote($id, "integer").", ".$ilDB->quote($this->record->getId(), "integer").", ".$ilDB->quote($this->field->getId(), "text").")";
$ilDB->manipulate($query);
$this->id = $id;
}

+ Here is the caller graph for this function:

ilDataCollectionRecordField::doRead ( )
private

Reimplemented in ilDataCollectionRatingField.

Definition at line 40 of file class.ilDataCollectionRecordField.php.

References $query, doCreate(), and loadValue().

Referenced by __construct().

{
global $ilDB;
$query = "SELECT * FROM il_dcl_record_field WHERE field_id LIKE ".$ilDB->quote($this->field->getId(), "text")." AND record_id = ".$ilDB->quote($this->record->getId(), "integer");
$set = $ilDB->query($query);
$rec = $ilDB->fetchAssoc($set);
$this->id = $rec['id'];
if($this->id == NULL)
{
$this->doCreate();
}
$this->loadValue();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionRecordField::doUpdate ( )

Reimplemented in ilDataCollectionRatingField.

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

References $query, and $value.

{
global $ilDB;
//$this->loadValue(); //Removed Mantis ILIAS #0011799
$datatype = $this->field->getDatatype();
$query = "DELETE FROM il_dcl_stloc".$datatype->getStorageLocation()."_value WHERE record_field_id = ".$ilDB->quote($this->id, "integer");
$ilDB->manipulate($query);
$next_id = $ilDB->nextId("il_dcl_stloc".$datatype->getStorageLocation()."_value");
$ilDB->insert("il_dcl_stloc".$datatype->getStorageLocation()."_value",
array("value" => array($datatype->getDbType(), $this->value),
"record_field_id " => array("integer", $this->id),
"id" => array("integer", $next_id))
);
}
ilDataCollectionRecordField::getExportValue ( )

Reimplemented in ilDataCollectionReferenceField, ilDataCollectionILIASRefField, and ilDataCollectionRatingField.

Definition at line 149 of file class.ilDataCollectionRecordField.php.

References getValue().

Referenced by getPlainText().

{
$datatype = $this->field->getDatatype();
return $datatype->parseExportValue($this->getValue());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionRecordField::getFormInput ( )

Reimplemented in ilDataCollectionRatingField.

Definition at line 139 of file class.ilDataCollectionRecordField.php.

References getValue().

{
$datatype = $this->field->getDatatype();
return $datatype->parseFormInput($this->getValue(), $this);
}

+ Here is the call graph for this function:

ilDataCollectionRecordField::getHTML ( )

Reimplemented in ilDataCollectionRatingField.

Definition at line 166 of file class.ilDataCollectionRecordField.php.

References getValue().

Referenced by getSingleHTML().

{
$datatype = $this->field->getDatatype();
return $datatype->parseHTML($this->getValue(), $this);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionRecordField::getId ( )
ilDataCollectionRecordField::getPlainText ( )
Returns
mixed used for the sorting.

Definition at line 159 of file class.ilDataCollectionRecordField.php.

References getExportValue().

{
return $this->getExportValue();
}

+ Here is the call graph for this function:

ilDataCollectionRecordField::getRecord ( )
ilDataCollectionRecordField::getSingleHTML (   $link = null)

this funciton is used to in the viewdefinition of a single record.

By default it returns the getHTML methods return.

Returns
mixed

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

References getHTML().

{
return $this->getHTML($link);
}

+ Here is the call graph for this function:

ilDataCollectionRecordField::loadValue ( )
protected

Reimplemented in ilDataCollectionRatingField.

Definition at line 183 of file class.ilDataCollectionRecordField.php.

References $query.

Referenced by doRead(), getValue(), and setValue().

{
if($this->value === NULL)
{
global $ilDB;
$datatype = $this->field->getDatatype();
$query = "SELECT * FROM il_dcl_stloc".$datatype->getStorageLocation()."_value WHERE record_field_id = ".$ilDB->quote($this->id, "integer");
$set = $ilDB->query($query);
$rec = $ilDB->fetchAssoc($set);
$this->value = $rec['value'];
}
}

+ Here is the caller graph for this function:

ilDataCollectionRecordField::setValue (   $value)

Reimplemented in ilDataCollectionRatingField.

Definition at line 117 of file class.ilDataCollectionRecordField.php.

References $value, ilDataCollectionDatatype\INPUTFORMAT_FILE, and loadValue().

{
$type = $this->field->getDatatype()->getId();
$this->loadValue();
$tmp = $this->field->getDatatype()->parseValue($value, $this);
$old = $this->value;
//if parse value fails keep the old value
// if($tmp !== null) //$tmp can be null to store NULL values in DB
if ($tmp !== false)
{
$this->value = $tmp;
//delete old file from filesystem
if($old && $this->field->getDatatypeId() == ilDataCollectionDatatype::INPUTFORMAT_FILE)
{
$this->record->deleteFile($old);
}
}
}

+ Here is the call graph for this function:

Field Documentation

ilDataCollectionRecordField::$field
protected

Definition at line 23 of file class.ilDataCollectionRecordField.php.

Referenced by __construct(), and getField().

ilDataCollectionRecordField::$id
protected
ilDataCollectionRecordField::$record
protected

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

Referenced by __construct(), and getRecord().


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