Skip to content

Commit

Permalink
Add persistent class for the cms table
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusboon committed May 23, 2023
1 parent b78c37f commit 5144425
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions classes/model/cms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* A persistent for the cms table.
*
* @package mod_cms
* @author Marcus Boon<marcus@catalyst-au.net>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace mod_cms\model;

use stdClass;
use core\persistent;

class cms extends persistent {

/**
* Table name.
*/
const TABLE = 'cms';

/**
* Return the definition of the properties of this model.
*
* @return array
*/
protected static function define_properties(): array {
return [
'course' => [
'type' => PARAM_INT,
'default' => 0,
],
'name' => [
'type' => PARAM_TEXT,
],
'intro' => [
'type' => PARAM_TEXT,
'null' => NULL_ALLOWED,
],
'introformat' => [
'type' => PARAM_INT,
'default' => 0,
],
'typeid' => [
'type' => PARAM_INT,
],
'grade' => [
'type' => PARAM_INT,
'default' => 0,
],
];
}
}

0 comments on commit 5144425

Please sign in to comment.