Class ilObj<module_name> More...
Inheritance diagram for ilCourseStart:
Collaboration diagram for ilCourseStart:Public Member Functions | |
| ilCourseStart ($a_course_ref_id, $a_course_obj_id) | |
| Constructor public. | |
| setId ($a_id) | |
| set object id public | |
| getId () | |
| get object id public | |
| setRefId ($a_ref_id) | |
| set reference id public | |
| getRefId () | |
| get reference id public | |
| getStartObjects () | |
| cloneDependencies ($a_target_id, $a_copy_id) | |
| Clone dependencies. | |
| delete ($a_crs_start_id) | |
| exists ($a_item_ref_id) | |
| add ($a_item_ref_id) | |
| __deleteAll () | |
| getPossibleStarters (&$item_obj) | |
| allFullfilled ($user_id) | |
| isFullfilled ($user_id, $item_id) | |
| __read () | |
Data Fields | |
| $db | |
| $ref_id | |
| $id | |
| $start_objs = array() | |
Class ilObj<module_name>
Definition at line 33 of file class.ilCourseStart.php.
| ilCourseStart::__deleteAll | ( | ) |
Definition at line 159 of file class.ilCourseStart.php.
References getId().
{
global $ilDB;
$query = "DELETE FROM crs_start ".
"WHERE crs_id = ".$ilDB->quote($this->getId())." ";
$this->db->query($query);
return true;
}
Here is the call graph for this function:| ilCourseStart::__read | ( | ) |
Definition at line 250 of file class.ilCourseStart.php.
Referenced by ilCourseStart().
{
global $tree,$ilDB;
$this->start_objs = array();
$query = "SELECT * FROM crs_start ".
"WHERE crs_id = ".$ilDB->quote($this->getId())." ";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if($tree->isInTree($row->item_ref_id))
{
$this->start_objs[$row->crs_start_id]['item_ref_id'] = $row->item_ref_id;
}
else
{
$this->delete($row->item_ref_id);
}
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseStart::add | ( | $ | a_item_ref_id | ) |
Definition at line 142 of file class.ilCourseStart.php.
References getId().
Referenced by ilObjCourseGUI::addStarterObject().
{
global $ilDB;
if($a_item_ref_id)
{
$query = "INSERT INTO crs_start ".
"SET crs_id = ".$ilDB->quote($this->getId()).", ".
"item_ref_id = ".$ilDB->quote($a_item_ref_id)." ";
$this->db->query($query);
return true;
}
return false;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseStart::allFullfilled | ( | $ | user_id | ) |
Definition at line 189 of file class.ilCourseStart.php.
References getStartObjects(), and isFullfilled().
{
foreach($this->getStartObjects() as $item)
{
if(!$this->isFullfilled($user_id,$item['item_ref_id']))
{
return false;
}
}
return true;
}
Here is the call graph for this function:| ilCourseStart::cloneDependencies | ( | $ | a_target_id, | |
| $ | a_copy_id | |||
| ) |
Clone dependencies.
public
| int | target id | |
| int | copy id |
Reimplemented from ilObject.
Definition at line 87 of file class.ilCourseStart.php.
References $data, $ilLog, ilCopyWizardOptions::_getInstance(), getStartObjects(), and ilCourseStart().
{
global $ilObjDataCache,$ilLog;
$ilLog->write(__METHOD__.': Begin course start objects...');
$new_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
$start = new ilCourseStart($a_target_id,$new_obj_id);
include_once('Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
$cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
$mappings = $cwo->getMappings();
foreach($this->getStartObjects() as $start_id => $data)
{
$item_ref_id = $data['item_ref_id'];
if(isset($mappings[$item_ref_id]) and $mappings[$item_ref_id])
{
$ilLog->write(__METHOD__.': Clone start object nr. '.$item_ref_id);
$start->add($mappings[$item_ref_id]);
}
else
{
$ilLog->write(__METHOD__.': No mapping found for start object nr. '.$item_ref_id);
}
}
$ilLog->write(__METHOD__.': ... end course start objects');
return true;
}
Here is the call graph for this function:| ilCourseStart::delete | ( | $ | a_crs_start_id | ) |
Definition at line 116 of file class.ilCourseStart.php.
References getId().
{
global $ilDB;
$query = "DELETE FROM crs_start ".
"WHERE crs_start_id = ".$ilDB->quote($a_crs_start_id)." ".
"AND crs_id = ".$ilDB->quote($this->getId())." ";
$this->db->query($query);
return true;
}
Here is the call graph for this function:| ilCourseStart::exists | ( | $ | a_item_ref_id | ) |
Definition at line 129 of file class.ilCourseStart.php.
{
global $ilDB;
$query = "SELECT * FROM crs_start ".
"WHERE crs_id = ".$ilDB->quote($this->getId())." ".
"AND item_ref_id = ".$a_item_ref_id." ";
$res = $this->db->query($query);
return $res->numRows() ? true : false;
}
Here is the call graph for this function:| ilCourseStart::getId | ( | ) |
get object id public
Reimplemented from ilObject.
Definition at line 62 of file class.ilCourseStart.php.
Referenced by __deleteAll(), __read(), add(), delete(), and exists().
{
return $this->id;
}
Here is the caller graph for this function:| ilCourseStart::getPossibleStarters | ( | &$ | item_obj | ) |
Definition at line 172 of file class.ilCourseStart.php.
{
foreach($item_obj->getItems() as $node)
{
switch($node['type'])
{
case 'lm':
case 'sahs':
case 'svy':
case 'tst':
$poss_items[] = $node['ref_id'];
break;
}
}
return $poss_items ? $poss_items : array();
}
| ilCourseStart::getRefId | ( | ) |
get reference id public
Reimplemented from ilObject.
Definition at line 70 of file class.ilCourseStart.php.
Referenced by isFullfilled().
{
return $this->ref_id;
}
Here is the caller graph for this function:| ilCourseStart::getStartObjects | ( | ) |
Definition at line 74 of file class.ilCourseStart.php.
Referenced by allFullfilled(), and cloneDependencies().
{
return $this->start_objs ? $this->start_objs : array();
}
Here is the caller graph for this function:| ilCourseStart::ilCourseStart | ( | $ | a_course_ref_id, | |
| $ | a_course_obj_id | |||
| ) |
Constructor public.
| integer | reference_id or object_id | |
| boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 47 of file class.ilCourseStart.php.
References __read().
Referenced by cloneDependencies().
{
global $ilDB;
$this->db =& $ilDB;
$this->ref_id = $a_course_ref_id;
$this->id = $a_course_obj_id;
$this->__read();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseStart::isFullfilled | ( | $ | user_id, | |
| $ | item_id | |||
| ) |
Definition at line 202 of file class.ilCourseStart.php.
References ilObject::$type, ilObjTestAccess::_checkCondition(), ilLPStatusWrapper::_getCompleted(), ilObjSurveyAccess::_lookupFinished(), and getRefId().
Referenced by allFullfilled().
{
global $ilObjDataCache;
include_once './Modules/Course/classes/class.ilCourseLMHistory.php';
$lm_continue =& new ilCourseLMHistory($this->getRefId(),$user_id);
$continue_data = $lm_continue->getLMHistory();
$obj_id = $ilObjDataCache->lookupObjId($item_id);
$type = $ilObjDataCache->lookupType($obj_id);
switch($type)
{
case 'tst':
include_once './Modules/Test/classes/class.ilObjTestAccess.php';
if(!ilObjTestAccess::_checkCondition($obj_id,'finished',''))
{
return false;
}
break;
case 'svy':
include_once './Modules/Survey/classes/class.ilObjSurveyAccess.php';
if(!ilObjSurveyAccess::_lookupFinished($obj_id, $user_id))
{
return false;
}
break;
case 'sahs':
include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
$completed = ilLPStatusWrapper::_getCompleted($obj_id);
if(!in_array($user_id,$completed))
{
return false;
}
break;
default:
if(!isset($continue_data[$item_id]))
{
return false;
}
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilCourseStart::setId | ( | $ | a_id | ) |
set object id public
| integer | $a_id object id |
Reimplemented from ilObject.
Definition at line 58 of file class.ilCourseStart.php.
{
$this->id = $a_id;
}
| ilCourseStart::setRefId | ( | $ | a_id | ) |
set reference id public
| integer | $a_id reference id |
Reimplemented from ilObject.
Definition at line 66 of file class.ilCourseStart.php.
{
$this->ref_id = $a_ref_id;
}
| ilCourseStart::$db |
Definition at line 35 of file class.ilCourseStart.php.
| ilCourseStart::$id |
Reimplemented from ilObject.
Definition at line 38 of file class.ilCourseStart.php.
| ilCourseStart::$ref_id |
Reimplemented from ilObject.
Definition at line 37 of file class.ilCourseStart.php.
| ilCourseStart::$start_objs = array() |
Definition at line 39 of file class.ilCourseStart.php.
1.7.1