|
Moodle
2.2.1
http://www.collinsharper.com
|

Public Member Functions | |
| __construct ($params=NULL, $fetch=true) | |
| load_optional_fields () | |
| update ($source=null) | |
| delete ($source=null) | |
| get_record_data () | |
| insert ($source=null) | |
| update_from_db () | |
| notify_changed ($deleted) | |
| is_hidden () | |
| is_hiddenuntil () | |
| get_hidden () | |
| set_hidden ($hidden, $cascade=false) | |
Static Public Member Functions | |
| static | fetch ($params) |
| static | fetch_all ($params) |
| static | fetch_all_helper ($table, $classname, $params) |
| static | set_properties (&$instance, $params) |
Data Fields | |
| $table | |
| $required_fields = array('id', 'timecreated', 'timemodified', 'hidden') | |
| $optional_fields = array() | |
| $id | |
| $timecreated | |
| $timemodified | |
| $hidden = 0 | |
Static Protected Member Functions | |
| static | fetch_helper ($table, $classname, $params) |
An abstract object that holds methods and attributes common to all grade_* objects defined here.
Definition at line 31 of file grade_object.php.
| __construct | ( | $ | params = NULL, |
| $ | fetch = true |
||
| ) |
Constructor. Optionally (and by default) attempts to fetch corresponding row from DB.
| array | $params | an array with required parameters for this grade object. |
| boolean | $fetch | Whether to fetch corresponding row from DB or not, optional fields might not be defined if false used |
Definition at line 77 of file grade_object.php.

| delete | ( | $ | source = null | ) |
Deletes this object from the database.
| string | $source | from where was the object deleted (mod/forum, manual, etc.) |
Reimplemented in grade_item, grade_category, grade_scale, and grade_outcome.
Definition at line 241 of file grade_object.php.

| static fetch | ( | $ | params | ) | [static] |
Finds and returns a grade_object instance based on params. abstract
| array | $params | associative arrays varname=>value |
Reimplemented in grade_grade, grade_item, grade_category, grade_outcome, and grade_scale.
Definition at line 122 of file grade_object.php.

| static fetch_all | ( | $ | params | ) | [static] |
Finds and returns all grade_object instances based on params. abstract
| array | $params | associative arrays varname=>value |
Reimplemented in grade_grade, grade_item, grade_category, grade_outcome, and grade_scale.
Definition at line 133 of file grade_object.php.
| static fetch_all_helper | ( | $ | table, |
| $ | classname, | ||
| $ | params | ||
| ) | [static] |
Factory method - uses the parameters to retrieve all matching instances from the DB. final protected
Definition at line 159 of file grade_object.php.


| static fetch_helper | ( | $ | table, |
| $ | classname, | ||
| $ | params | ||
| ) | [static, protected] |
Factory method - uses the parameters to retrieve matching instance from the DB. final protected
Definition at line 142 of file grade_object.php.


| get_hidden | ( | ) |
Check grade item hidden status.
Reimplemented in grade_grade.
Definition at line 392 of file grade_object.php.

| get_record_data | ( | ) |
Returns object with fields and values that are defined in database
Definition at line 273 of file grade_object.php.


| insert | ( | $ | source = null | ) |
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.
| string | $source | from where was the object inserted (mod/forum, manual, etc.) |
Reimplemented in grade_grade, grade_item, grade_category, grade_outcome, and grade_scale.
Definition at line 295 of file grade_object.php.

| is_hidden | ( | ) |
Returns the hidden state of this grade_item
Reimplemented in grade_grade.
Definition at line 376 of file grade_object.php.

| is_hiddenuntil | ( | ) |
Check grade hidden status. Uses data from both grade item and grade.
Reimplemented in grade_grade.
Definition at line 384 of file grade_object.php.
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.
Definition at line 101 of file grade_object.php.
| notify_changed | ( | $ | deleted | ) |
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.
| bool | $deleted |
Reimplemented in grade_grade.
Definition at line 369 of file grade_object.php.

| set_hidden | ( | $ | hidden, |
| $ | cascade = false |
||
| ) |
Reimplemented in grade_category, grade_item, and grade_grade.
Definition at line 396 of file grade_object.php.

| static set_properties | ( | &$ | instance, |
| $ | params | ||
| ) | [static] |
Given an associated array or object, cycles through each key/variable and assigns the value to the corresponding variable in this object. final
Reimplemented in grade_category.
Definition at line 353 of file grade_object.php.

| update | ( | $ | source = null | ) |
Updates this object in the Database, based on its object variables. ID must be set.
| string | $source | from where was the object updated (mod/forum, manual, etc.) |
Reimplemented in grade_grade, grade_item, grade_category, grade_outcome, and grade_scale.
Definition at line 210 of file grade_object.php.


| update_from_db | ( | ) |
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.
Definition at line 332 of file grade_object.php.


| int $hidden = 0 |
0 if visible, 1 always hidden or date not visible until
Reimplemented in grade_grade.
Definition at line 69 of file grade_object.php.
| int $id |
The PK.
Definition at line 51 of file grade_object.php.
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 grade_object($only_required_fields, false);
Reimplemented in grade_grade.
Definition at line 45 of file grade_object.php.
Array of required table fields, must start with 'id'.
Reimplemented in grade_category, grade_item, grade_outcome, grade_scale, and grade_grade.
Definition at line 38 of file grade_object.php.
Reimplemented in grade_category, grade_outcome, grade_scale, grade_item, and grade_grade.
Definition at line 32 of file grade_object.php.
| int $timecreated |
The first time this grade_object was created.
Reimplemented in grade_grade.
Definition at line 57 of file grade_object.php.
| int $timemodified |
The last time this grade_object was modified.
Reimplemented in grade_grade.
Definition at line 63 of file grade_object.php.