ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjCourseVerification Class Reference

Course Verification. More...

+ Inheritance diagram for ilObjCourseVerification:
+ Collaboration diagram for ilObjCourseVerification:

Static Public Member Functions

static createFromCourse (ilObjCourse $a_course, $a_user_id)
 Import relevant properties from given course.
- Static Public Member Functions inherited from ilVerificationObject
static initStorage ($a_id, $a_subdir=null)
- Static Public Member Functions inherited from ilObject2
static _lookupObjIdByImportId ($a_import_id)
static _getAllReferences ($a_id)
 get all reference ids of object
static _lookupTitle ($a_id)
 lookup object title
static _getIdsForTitle ($title, $type= '', $partialmatch=false)
static _lookupDescription ($a_id)
 lookup object description
static _lookupObjId ($a_id)
static _lookupType ($a_id, $a_reference=false)
 lookup object type
static _lookupObjectId ($a_ref_id)
 lookup object id
static _exists ($a_id, $a_reference=false)
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type.
static _prepareCloneSelection ($a_ref_ids, $new_type)
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item.
- Static Public Member Functions inherited from ilObject
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB.
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection.
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies.
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies.
static getLongDescriptions (array $a_obj_ids)
 Get long description data.
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns.
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course.

Protected Member Functions

 initType ()
 getPropertyMap ()
 Return property map (name => type)
- Protected Member Functions inherited from ilVerificationObject
 importProperty ($a_type, $a_data=null, $a_raw_data=null)
 Import property from database.
 exportProperty ($a_name)
 Export property to database.
 doRead ()
 Read database entry.
 saveProperties ()
 Save current properties to database.
 handleQuotaUpdate ()
- Protected Member Functions inherited from ilObject2
 beforeCreate ()
 beforeUpdate ()
 doMDUpdateListener ($a_element)
 beforeMDUpdateListener ($a_element)
 doCreateMetaData ()
 beforeCreateMetaData ()
 doUpdateMetaData ()
 beforeUpdateMetaData ()
 beforeDelete ()
 doCloneObject ($new_obj, $a_target_id, $a_copy_id=null)
 beforeCloneObject ()

Additional Inherited Members

- Public Member Functions inherited from ilVerificationObject
 __construct ($a_id=0, $a_reference=true)
 Constructor public.
 hasProperty ($a_name)
 Check if given property is valid.
 getPropertyType ($a_name)
 Get property data type.
 getProperty ($a_name)
 Get property value.
 setProperty ($a_name, $a_value)
 Set property value.
 doCreate ()
 doUpdate ()
 doDelete ()
 Delete entry from database.
 getFilePath ()
 getOfflineFilename ()
- Data Fields inherited from ilVerificationObject
const TYPE_STRING = 1
const TYPE_BOOL = 2
const TYPE_INT = 3
const TYPE_DATE = 4
const TYPE_RAW = 5
const TYPE_ARRAY = 6
- Protected Attributes inherited from ilVerificationObject
 $map = array()
 $properties = array()

Detailed Description

Course Verification.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 15 of file class.ilObjCourseVerification.php.

Member Function Documentation

static ilObjCourseVerification::createFromCourse ( ilObjCourse  $a_course,
  $a_user_id 
)
static

Import relevant properties from given course.

Parameters
ilObjCourse$a_course
Returns
object

Definition at line 35 of file class.ilObjCourseVerification.php.

References ilObject\$lng, $path, ilObject\getDescription(), ilObject\getId(), ilObject\getTitle(), IL_CAL_DATETIME, and ilVerificationObject\initStorage().

Referenced by ilObjCourseVerificationGUI\save().

{
global $lng;
$lng->loadLanguageModule("crs");
$newObj = new self();
$newObj->setTitle($a_course->getTitle());
$newObj->setDescription($a_course->getDescription());
include_once "Services/Tracking/classes/class.ilLPMarks.php";
$lp_marks = new ilLPMarks($a_course->getId(), $a_user_id);
$newObj->setProperty("issued_on",
new ilDate($lp_marks->getStatusChanged(), IL_CAL_DATETIME));
// create certificate
include_once "Services/Certificate/classes/class.ilCertificate.php";
include_once "Modules/Course/classes/class.ilCourseCertificateAdapter.php";
$certificate = new ilCertificate(new ilCourseCertificateAdapter($a_course));
$certificate = $certificate->outCertificate(array("user_id" => $a_user_id), false);
// save pdf file
if($certificate)
{
// we need the object id for storing the certificate file
$newObj->create();
$path = self::initStorage($newObj->getId(), "certificate");
$file_name = "crs_".$a_course->getId()."_".$a_user_id.".pdf";
if(file_put_contents($path.$file_name, $certificate))
{
$newObj->setProperty("file", $file_name);
$newObj->update();
return $newObj;
}
// file creation failed, so remove to object, too
$newObj->delete();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCourseVerification::getPropertyMap ( )
protected

Return property map (name => type)

Returns
array

Reimplemented from ilVerificationObject.

Definition at line 22 of file class.ilObjCourseVerification.php.

{
return array("issued_on" => self::TYPE_DATE,
"file" => self::TYPE_STRING
);
}
ilObjCourseVerification::initType ( )
protected

Reimplemented from ilObject2.

Definition at line 17 of file class.ilObjCourseVerification.php.

{
$this->type = "crsv";
}

The documentation for this class was generated from the following file: