ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAdvancedMDValue Class Reference
+ Collaboration diagram for ilAdvancedMDValue:

Public Member Functions

 __construct ($a_field_id, $a_obj_id=0)
 Singleton constructor.
 __toString ()
 To string method.
 setObjId ($a_obj_id)
 set object id
 appendXML ($xml_writer)
 append value xml
 setValue ($a_value)
 Set value.
 getValue ()
 get value
 isDisabled ()
 Check if value is imported and therefore disabled.
 toggleDisabledStatus ($a_status)
 Toggle disabled status.
 delete ()
 Delete value.
 save ()
 Save data.

Static Public Member Functions

static _getInstance ($a_obj_id, $a_field_id)
 Get instance.

Protected Attributes

 $db

Private Member Functions

 read ()
 Read data.

Private Attributes

 $obj_id
 $field_id
 $value
 $disabled = false

Static Private Attributes

static $instances = array()

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 33 of file class.ilAdvancedMDValue.php.

Constructor & Destructor Documentation

ilAdvancedMDValue::__construct (   $a_field_id,
  $a_obj_id = 0 
)

Singleton constructor.

private

Parameters
intfield_id
intobj_id

Definition at line 52 of file class.ilAdvancedMDValue.php.

References $ilDB, and read().

{
global $ilDB;
$this->db = $ilDB;
$this->obj_id = $a_obj_id;
$this->field_id = $a_field_id;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilAdvancedMDValue::__toString ( )

To string method.

public

Definition at line 87 of file class.ilAdvancedMDValue.php.

References $value.

{
return $this->value;
}
static ilAdvancedMDValue::_getInstance (   $a_obj_id,
  $a_field_id 
)
static

Get instance.

public

Parameters

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

Referenced by ilAdvancedMDValues\_appendXMLByObjId(), ilAdvancedMDRecordGUI\loadECSDurationPost(), ilAdvancedMDRecordGUI\loadFromPost(), ilAdvancedMDRecordGUI\parseEditor(), ilAdvancedMDRecordGUI\parseInfoPage(), ilAdvancedMDRecordGUI\showECSStart(), and ilObjRemoteCourse\updateFromECSContent().

{
if(isset(self::$instances[$a_obj_id][$a_field_id]))
{
return self::$instances[$a_obj_id][$a_field_id];
}
return self::$instances[$a_obj_id][$a_field_id] = new ilAdvancedMDValue($a_field_id,$a_obj_id);
}

+ Here is the caller graph for this function:

ilAdvancedMDValue::appendXML (   $xml_writer)

append value xml

public

Parameters
objectinstance of ilXmlWriter

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

References ilAdvancedMDFieldDefinition\_lookupImportId(), and getValue().

{
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
$xml_writer->xmlElement('Value',
array('id' => ilAdvancedMDFieldDefinition::_lookupImportId($this->field_id)),
$this->getValue());
}

+ Here is the call graph for this function:

ilAdvancedMDValue::delete ( )

Delete value.

public

Definition at line 174 of file class.ilAdvancedMDValue.php.

References $ilDB, $query, and $res.

{
global $ilDB;
$query = "DELETE FROM adv_md_values ".
"WHERE obj_id = ".$this->db->quote($this->obj_id ,'integer')." ".
"AND field_id = ".$this->db->quote($this->field_id ,'integer');
$res = $ilDB->manipulate($query);
}
ilAdvancedMDValue::getValue ( )

get value

public

Definition at line 138 of file class.ilAdvancedMDValue.php.

References $value.

Referenced by appendXML(), and save().

{
return $this->value;
}

+ Here is the caller graph for this function:

ilAdvancedMDValue::isDisabled ( )

Check if value is imported and therefore disabled.

This is the case for imported course links.

public

Parameters

Definition at line 151 of file class.ilAdvancedMDValue.php.

References $disabled.

Referenced by save().

{
return (bool) $this->disabled;
}

+ Here is the caller graph for this function:

ilAdvancedMDValue::read ( )
private

Read data.

private

Definition at line 211 of file class.ilAdvancedMDValue.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, setValue(), and toggleDisabledStatus().

Referenced by __construct().

{
global $ilDB;
if(!$this->obj_id or !$this->field_id)
{
return;
}
$query = "SELECT * FROM adv_md_values ".
"WHERE obj_id = ".$this->db->quote($this->obj_id ,'integer')." ".
"AND field_id = ".$this->db->quote($this->field_id ,'integer')." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setValue($row->value);
$this->toggleDisabledStatus((bool) $row->disabled);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDValue::save ( )

Save data.

public

Definition at line 190 of file class.ilAdvancedMDValue.php.

References $ilDB, $query, $res, getValue(), and isDisabled().

{
global $ilDB;
$this->delete();
$query = "INSERT INTO adv_md_values (obj_id,field_id,value,disabled) ".
"VALUES( ".
$this->db->quote($this->obj_id ,'integer').", ".
$this->db->quote($this->field_id ,'integer').", ".
$this->db->quote($this->getValue() ,'text').", ".
$ilDB->quote($this->isDisabled(),'integer')." ".
")";
$res = $ilDB->manipulate($query);
}

+ Here is the call graph for this function:

ilAdvancedMDValue::setObjId (   $a_obj_id)

set object id

public

Parameters
intobj_id

Definition at line 99 of file class.ilAdvancedMDValue.php.

{
$this->obj_id = $a_obj_id;
}
ilAdvancedMDValue::setValue (   $a_value)

Set value.

public

Parameters
stringvalue

Definition at line 128 of file class.ilAdvancedMDValue.php.

Referenced by read().

{
$this->value = $a_value;
}

+ Here is the caller graph for this function:

ilAdvancedMDValue::toggleDisabledStatus (   $a_status)

Toggle disabled status.

public

Parameters
booldisabled status

Definition at line 163 of file class.ilAdvancedMDValue.php.

Referenced by read().

{
$this->disabled = (bool) $a_status;
}

+ Here is the caller graph for this function:

Field Documentation

ilAdvancedMDValue::$db
protected

Definition at line 37 of file class.ilAdvancedMDValue.php.

ilAdvancedMDValue::$disabled = false
private

Definition at line 42 of file class.ilAdvancedMDValue.php.

Referenced by isDisabled().

ilAdvancedMDValue::$field_id
private

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

ilAdvancedMDValue::$instances = array()
staticprivate

Definition at line 35 of file class.ilAdvancedMDValue.php.

ilAdvancedMDValue::$obj_id
private

Definition at line 39 of file class.ilAdvancedMDValue.php.

ilAdvancedMDValue::$value
private

Definition at line 41 of file class.ilAdvancedMDValue.php.

Referenced by __toString(), and getValue().


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