5 require_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.");
162 $prg->subtype_id = self::DEFAULT_SUBTYPE;
163 $prg->setObjId($a_object->
getId())
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;
setSubtypeId($subtype_id)
Sets the meta-data type id.
setStatus($a_status)
Set the status of the node.
getLPMode()
Get the lp mode.
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.
updateLastChange()
Update the last change timestamp to the current time.
static now()
Return current timestamp in Y-m-d H:i:s format.
getObjId()
Get the id of the study program.
getId()
get object id public
getStatus()
Get the status.
static returnDbTableName()
getPoints()
Get the amount of points.
get($a_format, $a_format_str='', $a_tz='')
get formatted date
getType()
get object type public
Create styles array
The data for the language used.
static createForObject(ilObject $a_object)
Create new study program settings for an object.
setLastChange(ilDateTime $a_timestamp)
Set the last change timestamp to the given time.
getSubtypeId()
Return the meta-data subtype id.
getLastChange()
Get the timestamp of the last change on this program or a sub program.
setLPMode($a_mode)
Set the lp mode.
setPoints($a_points)
Set the amount of points.