ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilForumDataSet Class Reference

Forum data set class. More...

+ Inheritance diagram for ilForumDataSet:
+ Collaboration diagram for ilForumDataSet:

Public Member Functions

 getSupportedVersions ($a_entity)
 Get supported versions.
 getXmlNamespace ($a_entity, $a_target_release)
 Get xml namespace.
 readData ($a_entity, $a_version, $a_ids, $a_field="")
 Read data.
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 Import record.
- Public Member Functions inherited from ilDataSet
 __construct ()
 Constructor.
 init ($a_entity, $a_target_release)
 Init.
 readData ($a_entity, $a_version, $a_ids)
 Read data from DB.
 setExportDirectories ($a_relative, $a_absolute)
 Set export directories.
 setImportDirectory ($a_val)
 Set import directory.
 getImportDirectory ()
 Get import directory.
 setDSPrefix ($a_val)
 Set XML dataset namespace prefix.
 getDSPrefix ()
 Get XML dataset namespace prefix.
 getDSPrefixString ()
 getDirectDataFromQuery ($a_query, $a_convert_to_leading_upper=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields.
 convertToLeadingUpper ($a_str)
 Make xyz_abc a XyzAbc string.
 getJsonRepresentation ()
 Get json representation.
 getXmlRepresentation ($a_entity, $a_target_release, $a_ids, $a_field="", $a_omit_header=false, $a_omit_types=false)
 Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" version="4.0.1"> <ftype name="field_1" type="text"> <ftype name="field_2" type="date"> <ftype name="field_3" type="integer"> </types> <types ...> ...
 addRecordsXml ($a_writer, $a_prefixes, $a_entity, $a_target_release, $a_ids, $a_field="")
 Add records xml.
 getNamespaces (&$namespaces, $a_entity, $a_target_release)
 Get xml namespaces.
 getXmlRecord ($a_entity, $a_version, $a_set)
 Get xml record for version.
 getJsonRecord ($a_set)
 Get json record for version.
 getXmlTypes ($a_entity, $a_version)
 Get xml types.
 getJsonTypes ($a_entity, $a_version)
 Get json types.
 getXMLEntityName ($a_entity, $a_version)
 Get entity name for xml (may be overwritten)
 getXMLEntityTag ($a_entity, $a_target_release)
 Get entity tag.
 getJsonEntityName ($a_entity, $a_version)
 Get entity name for json (may be overwritten)
 setImport ($a_val)
 Set import object.
 getImport ()
 Get import object.

Protected Member Functions

 getTypes ($a_entity, $a_version)
 Get field types for entity.
 getDependencies ($a_entity, $a_version, $a_rec, $a_ids)
 Determine the dependent sets of data.

Additional Inherited Members

- Data Fields inherited from ilDataSet
 $dircnt

Detailed Description

Forum data set class.

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

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

Member Function Documentation

ilForumDataSet::getDependencies (   $a_entity,
  $a_version,
  $a_rec,
  $a_ids 
)
protected

Determine the dependent sets of data.

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

{
}
ilForumDataSet::getSupportedVersions (   $a_entity)

Get supported versions.

Parameters
@return

Reimplemented from ilDataSet.

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

{
switch ($a_entity)
{
case "frm":
return array("4.1.0");
}
}
ilForumDataSet::getTypes (   $a_entity,
  $a_version 
)
protected

Get field types for entity.

Parameters
@return

Reimplemented from ilDataSet.

Definition at line 47 of file class.ilForumDataSet.php.

{
if ($a_entity == "frm")
{
switch ($a_version)
{
case "4.1.0":
return array(
"Id" => "integer",
"Title" => "text",
'Description' => 'text',
"DefaultView" => "integer",
"Pseudonyms" => "integer",
"Statistics" => "integer",
"PostingActivation" => "integer",
"PresetSubject" => "integer",
"PresetRe" => "integer",
"NotificationType" => "text",
"ForceNotification" => "integer",
"ToggleNotification" => "integer"
);
}
}
}
ilForumDataSet::getXmlNamespace (   $a_entity,
  $a_target_release 
)

Get xml namespace.

Parameters
@return

Reimplemented from ilDataSet.

Definition at line 36 of file class.ilForumDataSet.php.

{
return "http://www.ilias.de/xml/Modules/Forum/".$a_entity;
}
ilForumDataSet::importRecord (   $a_entity,
  $a_types,
  $a_rec,
  $a_mapping,
  $a_schema_version 
)

Import record.

Parameters
@return

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

References ilForumProperties\getInstance(), and ilObjectFactory\getInstanceByObjId().

{
switch ($a_entity)
{
case "frm":
include_once("./Modules/Forum/classes/class.ilObjForum.php");
if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_rec['Id']))
{
$newObj = ilObjectFactory::getInstanceByObjId($new_id,false);
}
else
{
$newObj = new ilObjForum();
$newObj->setType("frm");
$newObj->create(true);
$newObj->saveData(array());
}
include_once './Modules/Forum/classes/class.ilForumProperties.php';
$newObjProp = ilForumProperties::getInstance($newObj->getId());
$newObj->setTitle($a_rec["Title"]);
$newObj->setDescription($a_rec["Description"]);
$newObjProp->setDefaultView((int) $a_rec['DefaultView']);
$newObjProp->setAnonymisation((int) $a_rec['Pseudonyms']);
$newObjProp->setStatisticsStatus((int) $a_rec['Statistics']);
$newObjProp->setPostActivation((int) $a_rec['PostingActivation']);
$newObjProp->setPresetSubject((int) $a_rec['PresetSubject']);
$newObjProp->setAddReSubject((int) $a_rec['PresetRe']);
$newObjProp->setNotificationType($a_rec['NotificationType']);
$newObjProp->setAdminForceNoti((int) $a_rec['ForceNotification']);
$newObjProp->setUserToggleNoti((int) $a_rec['ToggleNotification']);
$newObjProp->insert();
$newObj->update();
$this->current_obj = $newObj;
$a_mapping->addMapping("Modules/Forum", "frm", $a_rec["Id"], $newObj->getId());
break;
}
}

+ Here is the call graph for this function:

ilForumDataSet::readData (   $a_entity,
  $a_version,
  $a_ids,
  $a_field = "" 
)

Read data.

Parameters
@return

Definition at line 79 of file class.ilForumDataSet.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

{
global $ilDB;
if (!is_array($a_ids))
{
$a_ids = array($a_ids);
}
if ($a_entity == "frm")
{
switch ($a_version)
{
case "4.1.0":
$query = 'SELECT * FROM frm_settings fs '.
'JOIN object_data od ON fs.obj_id = od.obj_id '.
'WHERE '.$ilDB->in('fs.obj_id', $a_ids, false, 'integer');
$res = $ilDB->query($query);
$set = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$set['Id'] = $row->obj_id;
$set['Title'] = $row->title;
$set['Description'] = $row->description;
$set['DefaultView'] = (int) $row->default_view;
$set['Pseudonyms'] = (int) $row->anonymized;
$set['Statistics'] = (int) $row->statistics_enabled;
$set['PostingActivation'] = (int) $row->post_activation;
$set['PresetSubject'] = (int) $row->preset_subject;
$set['PresetRe'] = (int) $row->add_re_subject;
$set['NotificationType'] = $row->notification_type;
$set['ForceNotification'] = (int) $row->admin_force_noti;
$set['ToggleNotification'] = (int) $row->user_toggle_noti;
$this->data[] = $set;
}
break;
}
}
}

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