3 * StatusNet - the distributed open-source microblogging tool
4 * Copyright (C) 2012, StatusNet, Inc.
6 * ModLog.php -- data object to store moderation logs
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 * @category Moderation
25 * @author Evan Prodromou <evan@status.net>
26 * @copyright 2012 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET')) {
38 * @category Category here
40 * @author Evan Prodromou <evan@status.net>
41 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
42 * @link http://status.net/
47 class ModLog extends Managed_DataObject
49 public $__table = 'mod_log'; // table name
52 public $profile_id; // profile id
53 public $moderator_id; // profile id
54 public $role; // the role
55 public $grant; // 1 = grant, 0 = revoke
56 public $created; // datetime
59 * The One True Thingy that must be defined and declared.
61 public static function schemaDef()
63 return array('description' => 'Log of moderation events',
65 'id' => array('type' => 'varchar',
68 'description' => 'unique event ID'),
69 'profile_id' => array('type' => 'int',
71 'description' => 'profile getting the role'),
72 'moderator_id' => array('type' => 'int',
73 'description' => 'profile granting or revoking the role'),
74 'role' => array('type' => 'varchar',
77 'description' => 'role granted or revoked'),
78 'is_grant' => array('type' => 'int',
81 'description' => 'Was this a grant or revocation of a role'),
82 'created' => array('type' => 'datetime',
84 'description' => 'date this record was created')
86 'primary key' => array('id'),
87 'foreign keys' => array(
88 'mod_log_profile_id_fkey' => array('profile', array('profile_id' => 'id')),
89 'mod_log_moderator_id_fkey' => array('user', array('user_id' => 'id'))
92 'mod_log_profile_id_created_idx' => array('profile_id', 'created'),