ILIAS  release_4-4 Revision
ilMediaCastDataSet Class Reference

Media cast data set class. More...

+ Inheritance diagram for ilMediaCastDataSet:
+ Collaboration diagram for ilMediaCastDataSet:

Public Member Functions

 getSupportedVersions ()
 Get supported versions. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 readData ($a_entity, $a_version, $a_ids, $a_field="")
 Read data. More...
 
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 Import record. More...
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 Constructor. More...
 
 init ($a_entity, $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 Get supported version. More...
 
 readData ($a_entity, $a_version, $a_ids)
 Read data from DB. More...
 
 setExportDirectories ($a_relative, $a_absolute)
 Set export directories. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setDSPrefix ($a_val)
 Set XML dataset namespace prefix. More...
 
 getDSPrefix ()
 Get XML dataset namespace prefix. More...
 
 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. More...
 
 convertToLeadingUpper ($a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getJsonRepresentation ()
 Get json representation. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $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 ...> ... More...
 
 addRecordsXml ($a_writer, $a_prefixes, $a_entity, $a_schema_version, $a_ids, $a_field="")
 Add records xml. More...
 
 afterXmlRecordWriting ($a_entity, $a_version, $a_set)
 After xml record writing hook record. More...
 
 getNamespaces (&$namespaces, $a_entity, $a_schema_version)
 Get xml namespaces. More...
 
 getXmlRecord ($a_entity, $a_version, $a_set)
 Get xml record for version. More...
 
 getJsonRecord ($a_set)
 Get json record for version. More...
 
 getXmlTypes ($a_entity, $a_version)
 Get xml types. More...
 
 getJsonTypes ($a_entity, $a_version)
 Get json types. More...
 
 getXMLEntityName ($a_entity, $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag ($a_entity, $a_schema_version)
 Get entity tag. More...
 
 getJsonEntityName ($a_entity, $a_version)
 Get entity name for json (may be overwritten) More...
 
 setImport ($a_val)
 Set import object. More...
 
 getImport ()
 Get import object. More...
 

Protected Member Functions

 getTypes ($a_entity, $a_version)
 Get field types for entity. More...
 
 getDependencies ($a_entity, $a_version, $a_rec, $a_ids)
 Determine the dependent sets of data. More...
 
- Protected Member Functions inherited from ilDataSet
 getTypes ($a_entity, $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 createObjectExportId ($a_type, $a_id)
 Build ilias export id. More...
 
 parseObjectExportId ($a_id, $a_fallback_id=NULL)
 Parse export id. More...
 

Additional Inherited Members

- Data Fields inherited from ilDataSet
 $dircnt
 
const EXPORT_NO_INST_ID = 1
 
const EXPORT_ID_ILIAS_LOCAL = 2
 
const EXPORT_ID_ILIAS_LOCAL_INVALID = 3
 
const EXPORT_ID_ILIAS_REMOTE = 4
 
const EXPORT_ID_ILIAS_REMOTE_INVALID = 5
 
const EXPORT_ID = 6
 
const EXPORT_ID_INVALID = 7
 

Detailed Description

Media cast data set class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Member Function Documentation

◆ getDependencies()

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

Determine the dependent sets of data.

Definition at line 96 of file class.ilMediaCastDataSet.php.

97  {
98  return false;
99  }

◆ getSupportedVersions()

ilMediaCastDataSet::getSupportedVersions ( )

Get supported versions.

Parameters

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

22  {
23  return array("4.1.0");
24  }

◆ getTypes()

ilMediaCastDataSet::getTypes (   $a_entity,
  $a_version 
)
protected

Get field types for entity.

Parameters

Definition at line 43 of file class.ilMediaCastDataSet.php.

44  {
45  if ($a_entity == "mcst")
46  {
47  switch ($a_version)
48  {
49  case "4.1.0":
50  return array(
51  "Id" => "integer",
52  "Title" => "text",
53  "Description" => "text",
54  "PublicFiles" => "integer",
55  "Downloadable" => "integer",
56  "DefaultAccess" => "integer");
57  }
58  }
59 
60  }

◆ getXmlNamespace()

ilMediaCastDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

Definition at line 32 of file class.ilMediaCastDataSet.php.

33  {
34  return "http://www.ilias.de/xml/Modules/MediaCast/".$a_entity;
35  }

◆ importRecord()

ilMediaCastDataSet::importRecord (   $a_entity,
  $a_types,
  $a_rec,
  $a_mapping,
  $a_schema_version 
)

Import record.

Parameters

Definition at line 108 of file class.ilMediaCastDataSet.php.

References ilObjectFactory\getInstanceByObjId().

109  {
110 //echo $a_entity;
111 //var_dump($a_rec);
112 
113  switch ($a_entity)
114  {
115  case "mcst":
116  include_once("./Modules/MediaCast/classes/class.ilObjMediaCast.php");
117 
118  if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_rec['Id']))
119  {
120  $newObj = ilObjectFactory::getInstanceByObjId($new_id,false);
121  }
122  else
123  {
124  $newObj = new ilObjMediaCast();
125  $newObj->setType("mcst");
126  $newObj->create(true);
127  }
128 
129  $newObj->setTitle($a_rec["Title"]);
130  $newObj->setDescription($a_rec["Description"]);
131  $newObj->setDefaultAccess($a_rec["DefaultAccess"]);
132  $newObj->setDownloadable($a_rec["Downloadable"]);
133  $newObj->setPublicFiles($a_rec["PublicFiles"]);
134  $newObj->update(true);
135  $this->current_obj = $newObj;
136  $a_mapping->addMapping("Modules/MediaCast", "mcst", $a_rec["Id"], $newObj->getId());
137  $a_mapping->addMapping("Services/News", "news_context",
138  $a_rec["Id"].":mcst:0:",
139  $newObj->getId().":mcst:0:");
140 //var_dump($a_mapping->mappings["Services/News"]["news_context"]);
141  break;
142  }
143  }
Class ilObjMediaCast.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

◆ readData()

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

Read data.

Parameters

Definition at line 68 of file class.ilMediaCastDataSet.php.

References ilDataSet\getDirectDataFromQuery().

69  {
70  global $ilDB;
71 
72  if (!is_array($a_ids))
73  {
74  $a_ids = array($a_ids);
75  }
76 
77  if ($a_entity == "mcst")
78  {
79  switch ($a_version)
80  {
81  case "4.1.0":
82  $this->getDirectDataFromQuery("SELECT id, title, description, ".
83  " public_files, downloadable, def_access default_access".
84  " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) ".
85  "WHERE ".
86  $ilDB->in("id", $a_ids, false, "integer"));
87  break;
88  }
89  }
90 
91  }
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 ...
+ Here is the call graph for this function:

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