Course completion status for a particular user/course.
More...
|
| delete () |
| Deletes this object from the database.
|
|
| get_record_data () |
| Returns object with fields and values that are defined in database.
|
|
| insert () |
| Records this object in the Database, sets its id to the returned value, and returns that value.
|
|
| is_complete () |
| Return status of this completion.
|
|
| load_optional_fields () |
| Makes sure all the optional fields are loaded.
|
|
| mark_complete ($timecomplete=null) |
| Mark this user complete in this course.
|
|
| mark_enrolled ($timeenrolled=null) |
| Mark this user as started (or enrolled) in this course.
|
|
| mark_inprogress ($timestarted=null) |
| Mark this user as inprogress in this course.
|
|
| notify_changed ($deleted) |
| Called immediately after the object data has been inserted, updated, or deleted in the database.
|
|
| update () |
| Updates this object in the Database, based on its object variables.
|
|
| update_from_db () |
| Using this object's id field, fetches the matching record in the DB, and looks at each variable in turn.
|
|
|
static | fetch ($params) |
| Finds and returns a data_object instance based on params.
|
|
static | fetch_all ($params) |
| Finds and returns all data_object instances based on params.
|
|
static | fetch_all_helper ($table, $classname, $params) |
| Factory method - uses the parameters to retrieve all matching instances from the DB.
|
|
static | set_properties (&$instance, $params) |
| Given an associated array or object, cycles through each key/variable and assigns the value to the corresponding variable in this object.
|
|
|
int | $completedself |
| completed status.
|
|
int | $course |
|
float | $gradefinal |
| user's course grade.
|
|
int | $id |
|
array | $optional_fields = array() |
| Array of optional fields with default values - usually long text information that is not always needed.
|
|
int | $reaggregate |
|
array | $required_fields |
|
string | $table = 'course_completions' |
|
int | $timecompleted |
|
int | $timeenrolled |
|
int | $timestarted |
| Time the user started their course completion completion_completion::mark_inprogress().
|
|
Array | $unique_fields = array() |
|
int | $userid |
|
|
static | fetch_helper ($table, $classname, $params) |
| Factory method - uses the parameters to retrieve matching instance from the DB.
|
|
Course completion status for a particular user/course.
- Copyright
- 2009 Catalyst IT Ltd
- Author
- Aaron Barnes aaron.nosp@m.b@ca.nosp@m.talys.nosp@m.t.ne.nosp@m.t.nz
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ delete()
Deletes this object from the database.
- Return values
-
◆ fetch()
static completion_completion::fetch |
( |
| $params | ) |
|
|
static |
Finds and returns a data_object instance based on params.
- Parameters
-
array | $params | associative arrays varname = >value |
- Return values
-
Reimplemented from data_object.
◆ fetch_all()
static data_object::fetch_all |
( |
| $params | ) |
|
|
staticinherited |
◆ fetch_all_helper()
static data_object::fetch_all_helper |
( |
| $table, |
|
|
| $classname, |
|
|
| $params ) |
|
staticinherited |
Factory method - uses the parameters to retrieve all matching instances from the DB.
@final
- Parameters
-
string | $table | The table name to fetch from |
string | $classname | The class that you want the result instantiated as |
array | $params | Any params required to select the desired row |
- Return values
-
mixed | array of object instances or false if not found |
◆ fetch_helper()
static data_object::fetch_helper |
( |
| $table, |
|
|
| $classname, |
|
|
| $params ) |
|
staticprotectedinherited |
Factory method - uses the parameters to retrieve matching instance from the DB.
@final
- Parameters
-
string | $table | The table name to fetch from |
string | $classname | The class that you want the result instantiated as |
array | $params | Any params required to select the desired row |
- Return values
-
object | Instance of $classname or false. |
◆ get_record_data()
data_object::get_record_data |
( |
| ) |
|
|
inherited |
Returns object with fields and values that are defined in database.
- Return values
-
◆ insert()
Records this object in the Database, sets its id to the returned value, and returns that value.
If successful this function also fetches the new object data from database and stores it in object properties.
- Return values
-
int | PK ID if successful, false otherwise |
◆ is_complete()
completion_completion::is_complete |
( |
| ) |
|
Return status of this completion.
- Return values
-
◆ load_optional_fields()
data_object::load_optional_fields |
( |
| ) |
|
|
inherited |
Makes sure all the optional fields are loaded.
If id present (==instance exists in db) fetches data from db. Defaults are used for new instances.
◆ mark_complete()
completion_completion::mark_complete |
( |
| $timecomplete = null | ) |
|
Mark this user complete in this course.
This generally happens when the required completion criteria in the course are complete.
- Parameters
-
integer | $timecomplete | Time completed (optional) |
- Return values
-
int|null | id of completion record on successful update. |
◆ mark_enrolled()
completion_completion::mark_enrolled |
( |
| $timeenrolled = null | ) |
|
Mark this user as started (or enrolled) in this course.
If the user is already marked as started, no change will occur
- Parameters
-
integer | $timeenrolled | Time enrolled (optional) |
- Return values
-
int|null | id of completion record on successful update. |
◆ mark_inprogress()
completion_completion::mark_inprogress |
( |
| $timestarted = null | ) |
|
Mark this user as inprogress in this course.
If the user is already marked as inprogress, the time will not be changed
- Parameters
-
integer | $timestarted | Time started (optional) |
- Return values
-
int|null | id of completion record on successful update. |
◆ notify_changed()
data_object::notify_changed |
( |
| $deleted | ) |
|
|
inherited |
Called immediately after the object data has been inserted, updated, or deleted in the database.
Default does nothing, can be overridden to hook in special behaviour.
- Parameters
-
bool | $deleted | Set this to true if it has been deleted. |
◆ set_properties()
static data_object::set_properties |
( |
& | $instance, |
|
|
| $params ) |
|
staticinherited |
Given an associated array or object, cycles through each key/variable and assigns the value to the corresponding variable in this object.
@final
- Parameters
-
◆ update()
Updates this object in the Database, based on its object variables.
ID must be set.
- Return values
-
◆ update_from_db()
data_object::update_from_db |
( |
| ) |
|
|
inherited |
Using this object's id field, fetches the matching record in the DB, and looks at each variable in turn.
If the DB has different data, the db's data is used to update the object. This is different from the update() function, which acts on the DB record based on the object.
- Return values
-
bool | True for success, false otherwise. |
◆ $optional_fields
array data_object::$optional_fields = array() |
|
inherited |
Array of optional fields with default values - usually long text information that is not always needed.
If you want to create an instance without optional fields use: new data_object($only_required_fields, false);
◆ $required_fields
array completion_completion::$required_fields |
Initial value:= array('id', 'userid', 'course',
'timeenrolled', 'timestarted', 'timecompleted', 'reaggregate')
The documentation for this class was generated from the following file:
- completion/completion_completion.php