Inheritance diagram for ilSCORMResource:
Collaboration diagram for ilSCORMResource:Public Member Functions | |
| ilSCORMResource ($a_id=0) | |
| Constructor. | |
| getImportId () | |
| setImportId ($a_import_id) | |
| getResourceType () | |
| setResourceType ($a_type) | |
| getScormType () | |
| setScormType ($a_scormtype) | |
| getHRef () | |
| setHRef ($a_href) | |
| getXmlBase () | |
| setXmlBase ($a_xml_base) | |
| addFile (&$a_file_obj) | |
| & | getFiles () |
| addDependency (&$a_dependency) | |
| & | getDependencies () |
| read () | |
| readByIdRef ($a_id_ref, $a_slm_id) | |
| create () | |
| Create database record for SCORM object. | |
| update () | |
| Updates database record for SCORM object. | |
| delete () | |
Data Fields | |
| $import_id | |
| $resourcetype | |
| $scormtype | |
| $href | |
| $xml_base | |
| $files | |
| $dependencies | |
Definition at line 37 of file class.ilSCORMResource.php.
| ilSCORMResource::addDependency | ( | &$ | a_dependency | ) |
Definition at line 124 of file class.ilSCORMResource.php.
Referenced by read().
{
$this->dependencies[] =& $a_dependency;
}
Here is the caller graph for this function:| ilSCORMResource::addFile | ( | &$ | a_file_obj | ) |
Definition at line 114 of file class.ilSCORMResource.php.
Referenced by read().
{
$this->files[] =& $a_file_obj;
}
Here is the caller graph for this function:| ilSCORMResource::create | ( | ) |
Create database record for SCORM object.
Reimplemented from ilSCORMObject.
Definition at line 184 of file class.ilSCORMResource.php.
References $q, getImportId(), and getScormType().
{
parent::create();
$q = "INSERT INTO sc_resource (obj_id, import_id, resourcetype, scormtype, href, ".
"xml_base) VALUES ".
"('".$this->getId()."', '".$this->getImportId()."',".
"'".$this->getResourceType()."','".$this->getScormType()."','".$this->getHref()."'".
",'".$this->getXmlBase()."')";
$this->ilias->db->query($q);
// save files
for($i=0; $i<count($this->files); $i++)
{
$q = "INSERT INTO sc_resource_file (res_id, href, nr) VALUES ".
"('".$this->getId()."', '".$this->files[$i]->getHref()."','".($i + 1)."')";
$this->ilias->db->query($q);
}
// save dependencies
for($i=0; $i<count($this->dependencies); $i++)
{
$q = "INSERT INTO sc_resource_dependency (res_id, identifierref, nr) VALUES ".
"('".$this->getId()."', '".$this->dependencies[$i]->getIdentifierRef().
"','".($i + 1)."')";
$this->ilias->db->query($q);
}
}
Here is the call graph for this function:| ilSCORMResource::delete | ( | ) |
Reimplemented from ilSCORMObject.
Definition at line 248 of file class.ilSCORMResource.php.
References $q, and ilSCORMObject::getId().
{
global $ilDB;
parent::delete();
$q = "DELETE FROM sc_resource WHERE obj_id =".$ilDB->quote($this->getId());
$ilDB->query($q);
$q = "DELETE FROM sc_resource_file WHERE res_id =".$ilDB->quote($this->getId());
$ilDB->query($q);
$q = "DELETE FROM sc_resource_dependency WHERE res_id =".$ilDB->quote($this->getId());
$ilDB->query($q);
}
Here is the call graph for this function:| & ilSCORMResource::getDependencies | ( | ) |
Definition at line 129 of file class.ilSCORMResource.php.
{
return $this->dependencies;
}
| & ilSCORMResource::getFiles | ( | ) |
Definition at line 119 of file class.ilSCORMResource.php.
{
return $this->files;
}
| ilSCORMResource::getHRef | ( | ) |
Definition at line 93 of file class.ilSCORMResource.php.
{
return $this->href;
}
| ilSCORMResource::getImportId | ( | ) |
Definition at line 63 of file class.ilSCORMResource.php.
Referenced by create().
{
return $this->import_id;
}
Here is the caller graph for this function:| ilSCORMResource::getResourceType | ( | ) |
Definition at line 73 of file class.ilSCORMResource.php.
{
return $this->resourcetype;
}
| ilSCORMResource::getScormType | ( | ) |
Definition at line 83 of file class.ilSCORMResource.php.
Referenced by create().
{
return $this->scormtype;
}
Here is the caller graph for this function:| ilSCORMResource::getXmlBase | ( | ) |
Definition at line 104 of file class.ilSCORMResource.php.
{
return $this->xml_base;
}
| ilSCORMResource::ilSCORMResource | ( | $ | a_id = 0 |
) |
Constructor.
| int | $a_id Object ID public |
Definition at line 54 of file class.ilSCORMResource.php.
References ilSCORMObject::ilSCORMObject(), and ilSCORMObject::setType().
{
$this->files = array();
$this->dependencies = array();
$this->setType("sre");
parent::ilSCORMObject($a_id);
}
Here is the call graph for this function:| ilSCORMResource::read | ( | ) |
Reimplemented from ilSCORMObject.
Definition at line 134 of file class.ilSCORMResource.php.
References $q, addDependency(), addFile(), setHRef(), setImportId(), setResourceType(), setScormType(), and setXmlBase().
Referenced by readByIdRef().
{
parent::read();
$q = "SELECT * FROM sc_resource WHERE obj_id = '".$this->getId()."'";
$obj_set = $this->ilias->db->query($q);
$obj_rec = $obj_set->fetchRow(DB_FETCHMODE_ASSOC);
$this->setImportId($obj_rec["import_id"]);
$this->setResourceType($obj_rec["resourcetype"]);
$this->setScormType($obj_rec["scormtype"]);
$this->setHRef($obj_rec["href"]);
$this->setXmlBase($obj_rec["xml_base"]);
// read files
$q = "SELECT * FROM sc_resource_file WHERE res_id = '".$this->getId().
"' ORDER BY nr";
$file_set = $this->ilias->db->query($q);
while ($file_rec = $file_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$res_file =& new ilSCORMResourceFile();
$res_file->setHref($file_rec["href"]);
$this->addFile($res_file);
}
// read dependencies
$q = "SELECT * FROM sc_resource_dependency WHERE res_id = '".$this->getId().
"' ORDER BY nr";
$dep_set = $this->ilias->db->query($q);
while ($dep_rec = $dep_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$res_dep =& new ilSCORMResourceDependency();
$res_dep->setIdentifierRef($dep_rec["identifierref"]);
$this->addDependency($res_dep);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilSCORMResource::readByIdRef | ( | $ | a_id_ref, | |
| $ | a_slm_id | |||
| ) |
Definition at line 170 of file class.ilSCORMResource.php.
References $q, read(), and ilSCORMObject::setId().
{
$q = "SELECT ob.obj_id AS id FROM sc_resource AS res, scorm_object as ob ".
"WHERE ob.obj_id = res.obj_id ".
"AND res.import_id = '$a_id_ref'".
"AND ob.slm_id = '$a_slm_id'";
$id_set = $this->ilias->db->query($q);
if ($id_rec = $id_set->fetchRow(DB_FETCHMODE_ASSOC))
{
$this->setId($id_rec["id"]);
$this->read();
}
}
Here is the call graph for this function:| ilSCORMResource::setHRef | ( | $ | a_href | ) |
Definition at line 98 of file class.ilSCORMResource.php.
References ilSCORMObject::setTitle().
Referenced by read().
{
$this->href = $a_href;
$this->setTitle($a_href);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilSCORMResource::setImportId | ( | $ | a_import_id | ) |
Definition at line 68 of file class.ilSCORMResource.php.
Referenced by read().
{
$this->import_id = $a_import_id;
}
Here is the caller graph for this function:| ilSCORMResource::setResourceType | ( | $ | a_type | ) |
Definition at line 78 of file class.ilSCORMResource.php.
Referenced by read().
{
$this->resourcetype = $a_type;
}
Here is the caller graph for this function:| ilSCORMResource::setScormType | ( | $ | a_scormtype | ) |
Definition at line 88 of file class.ilSCORMResource.php.
Referenced by read().
{
$this->scormtype = $a_scormtype;
}
Here is the caller graph for this function:| ilSCORMResource::setXmlBase | ( | $ | a_xml_base | ) |
Definition at line 109 of file class.ilSCORMResource.php.
Referenced by read().
{
$this->xml_base = $a_xml_base;
}
Here is the caller graph for this function:| ilSCORMResource::update | ( | ) |
Updates database record for SCORM object.
Reimplemented from ilSCORMObject.
Definition at line 213 of file class.ilSCORMResource.php.
References $q.
{
parent::update();
$q = "UPDATE sc_resource SET ".
"import_id = '".$this->getImportId()."', ".
"resourcetype = '".$this->getResourceType()."', ".
"scormtype = '".$this->getScormType()."', ".
"href = '".$this->getHRef()."', ".
"xml_base = '".$this->getXmlBase()."' ".
"WHERE obj_id = '".$this->getId()."'";
$this->ilias->db->query($q);
// save files
$q = "DELETE FROM sc_resource_file WHERE res_id = '".$this->getId()."'";
$this->ilias->db->query($q);
for($i=0; $i<count($this->files); $i++)
{
$q = "INSERT INTO sc_resource_file (res_id, href, nr) VALUES ".
"('".$this->getId()."', '".$this->files[$i]->getHref()."','".($i + 1)."')";
$this->ilias->db->query($q);
}
// save dependencies
$q = "DELETE FROM sc_resource_dependency WHERE res_id = '".$this->getId()."'";
$this->ilias->db->query($q);
for($i=0; $i<count($this->dependencies); $i++)
{
$q = "INSERT INTO sc_resource_dependency (res_id, identifierref, nr) VALUES ".
"('".$this->getId()."', '".$this->dependencies[$i]->getIdentifierRef().
"','".($i + 1)."')";
$this->ilias->db->query($q);
}
}
| ilSCORMResource::$dependencies |
Definition at line 45 of file class.ilSCORMResource.php.
| ilSCORMResource::$files |
Definition at line 44 of file class.ilSCORMResource.php.
| ilSCORMResource::$href |
Definition at line 42 of file class.ilSCORMResource.php.
| ilSCORMResource::$import_id |
Definition at line 39 of file class.ilSCORMResource.php.
| ilSCORMResource::$resourcetype |
Definition at line 40 of file class.ilSCORMResource.php.
| ilSCORMResource::$scormtype |
Definition at line 41 of file class.ilSCORMResource.php.
| ilSCORMResource::$xml_base |
Definition at line 43 of file class.ilSCORMResource.php.
1.7.1