MDL-77350 tag: Added class properties that are not declared

This commit is contained in:
Meirza
2023-05-17 09:00:09 +07:00
committed by meirzamoodle
parent 8fa53a336e
commit 8b641a1b0d
+12
View File
@@ -74,6 +74,15 @@ class core_tag_tag {
/** @var int option to hide standard tags when editing item tags */
const HIDE_STANDARD = 2;
/** @var int|null tag context ID. */
public $taginstancecontextid;
/** @var int|null time modification. */
public $timemodified;
/** @var int|null 0 if not flagged or positive integer if flagged. */
public $flag;
/**
* Constructor. Use functions get(), get_by_name(), etc.
*
@@ -83,6 +92,9 @@ class core_tag_tag {
if (empty($record->id)) {
throw new coding_exception("Record must contain at least field 'id'");
}
// The following three variables must be added because the database ($record) does not contain them.
$this->taginstancecontextid = $record->taginstancecontextid ?? null;
$this->flag = $record->flag ?? null;
$this->record = $record;
}