5require_once(dirname(__FILE__).
"/../../../../Services/ActiveRecord/class.ActiveRecord.php");
59 return "prg_settings";
149 if ($a_object->
getType() !=
"prg") {
150 throw new ilException(
"ilStudyProgramme::createSettingsForObject: "
151 .
"Object is no prg object.");
153 if(!$a_object->
getId()) {
154 throw new ilException(
"ilStudyProgramme::createSettingsForObject: "
155 .
"Object has no id.");
160 $prg->setObjId($a_object->
getId())
161 ->setStatus(self::STATUS_DRAFT)
162 ->setLPMode(self::MODE_UNDEFINED)
163 ->setPoints(self::DEFAULT_POINTS)
170 $this->obj_id = $a_id;
231 throw new ilException(
"ilStudyProgramme::setLastChange: Given "
232 .
"timestamp is before current timestamp. That "
233 .
"is logically impossible.");
250 $a_points = (int)$a_points;
252 throw new ilException(
"ilStudyProgramme::setPoints: Points cannot "
253 .
"be smaller than zero.");
256 $this->points = $a_points;
279 $a_mode = (int)$a_mode;
280 if (!in_array($a_mode, self::$MODES)) {
281 throw new ilException(
"ilStudyProgramme::setLPMode: No lp mode: "
284 $this->lp_mode = $a_mode;
308 $a_status = (int)$a_status;
309 if (!in_array($a_status, self::$STATUS)) {
310 throw new ilException(
"ilStudyProgramme::setStatus: No lp mode: "
313 $this->status = $a_status;
@classDescription Date and time handling
get($a_format, $a_format_str='', $a_tz='')
get formatted date
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
Base class for ILIAS Exception handling.
Class ilObject Basic functions for all objects.
getType()
get object type @access public
getId()
get object id @access public
updateLastChange()
Update the last change timestamp to the current time.
getPoints()
Get the amount of points.
static createForObject(ilObject $a_object)
Create new study program settings for an object.
getSubtypeId()
Return the meta-data subtype id.
getLPMode()
Get the lp mode.
setLastChange(ilDateTime $a_timestamp)
Set the last change timestamp to the given time.
getStatus()
Get the status.
getLastChange()
Get the timestamp of the last change on this program or a sub program.
getObjId()
Get the id of the study program.
setLPMode($a_mode)
Set the lp mode.
setPoints($a_points)
Set the amount of points.
setStatus($a_status)
Set the status of the node.
static returnDbTableName()
setSubtypeId($subtype_id)
Sets the meta-data type id.
static now()
Return current timestamp in Y-m-d H:i:s format.