2012-11-06 15:24:05 +00:00
|
|
|
<?php
|
2019-09-11 09:25:39 +01:00
|
|
|
// This file is part of GNU social - https://www.gnu.org/software/social
|
|
|
|
//
|
|
|
|
// GNU social is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// GNU social 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 Affero General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// along with GNU social. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2012-11-06 15:24:05 +00:00
|
|
|
/**
|
|
|
|
* Data class to record user prefs for polls
|
|
|
|
*
|
2019-09-11 09:25:39 +01:00
|
|
|
* @category PollPlugin
|
|
|
|
* @package GNUsocial
|
|
|
|
* @author Brion Vibber <brion@status.net>
|
|
|
|
* @author Evan Prodromou <evan@status.net>
|
|
|
|
* @copyright 2012, StatusNet, Inc.
|
|
|
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
2012-11-06 15:24:05 +00:00
|
|
|
*/
|
|
|
|
|
2019-09-11 09:25:39 +01:00
|
|
|
defined('GNUSOCIAL') || die();
|
2012-11-06 15:24:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* For storing the poll prefs
|
|
|
|
*
|
2019-09-11 09:25:39 +01:00
|
|
|
* @copyright 2012, StatusNet, Inc.
|
|
|
|
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
2012-11-06 15:24:05 +00:00
|
|
|
*
|
|
|
|
* @see DB_DataObject
|
|
|
|
*/
|
|
|
|
class User_poll_prefs extends Managed_DataObject
|
|
|
|
{
|
|
|
|
public $__table = 'user_poll_prefs'; // table name
|
|
|
|
public $user_id; // int id
|
2019-09-11 09:25:39 +01:00
|
|
|
public $hide_responses; // bool
|
2012-11-06 15:24:05 +00:00
|
|
|
public $created; // datetime
|
|
|
|
public $modified; // datetime
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The One True Thingy that must be defined and declared.
|
|
|
|
*/
|
|
|
|
public static function schemaDef()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'description' => 'Record of user preferences for polls',
|
|
|
|
'fields' => array(
|
|
|
|
'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'user id'),
|
2019-09-11 09:25:39 +01:00
|
|
|
'hide_responses' => array('type' => 'bool', 'default' => false, 'description' => 'Hide all poll responses'),
|
2012-11-06 15:24:05 +00:00
|
|
|
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
|
|
|
|
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
|
|
|
|
),
|
|
|
|
'primary key' => array('user_id')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|