5require_once(dirname(__FILE__) .
"/../../../../Services/ActiveRecord/class.ActiveRecord.php");
61 return "prg_settings";
152 if ($a_object->
getType() !=
"prg") {
153 throw new ilException(
"ilStudyProgramme::createSettingsForObject: "
154 .
"Object is no prg object.");
156 if (!$a_object->
getId()) {
157 throw new ilException(
"ilStudyProgramme::createSettingsForObject: "
158 .
"Object has no id.");
163 $prg->setObjId($a_object->
getId())
164 ->setStatus(self::STATUS_DRAFT)
165 ->setLPMode(self::MODE_UNDEFINED)
166 ->setPoints(self::DEFAULT_POINTS)
174 $this->obj_id = $a_id;
241 throw new ilException(
"ilStudyProgramme::setLastChange: Given "
242 .
"timestamp is before current timestamp. That "
243 .
"is logically impossible.");
261 $a_points = (int) $a_points;
263 throw new ilException(
"ilStudyProgramme::setPoints: Points cannot "
264 .
"be smaller than zero.");
267 $this->points = $a_points;
292 $a_mode = (int) $a_mode;
293 if (!in_array($a_mode, self::$MODES)) {
294 throw new ilException(
"ilStudyProgramme::setLPMode: No lp mode: "
297 $this->lp_mode = $a_mode;
323 $a_status = (int) $a_status;
324 if (!in_array($a_status, self::$STATUS)) {
325 throw new ilException(
"ilStudyProgramme::setStatus: No lp mode: "
328 $this->status = $a_status;
An exception for terminatinating execution or to throw for unit testing.
@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.