2008-05-07 18:15:42 +01:00
|
|
|
<?php
|
2008-05-20 20:14:12 +01:00
|
|
|
/*
|
2009-08-25 23:14:12 +01:00
|
|
|
* StatusNet - the distributed open-source microblogging tool
|
2009-08-25 23:12:20 +01:00
|
|
|
* Copyright (C) 2008, 2009, StatusNet, Inc.
|
2008-05-20 20:14:12 +01:00
|
|
|
*
|
2008-05-14 20:26:48 +01:00
|
|
|
* This program 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.
|
2008-05-20 20:14:12 +01:00
|
|
|
*
|
2008-05-14 20:26:48 +01:00
|
|
|
* This program 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.
|
2008-05-20 20:14:12 +01:00
|
|
|
*
|
2008-05-14 20:26:48 +01:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2009-08-26 15:41:36 +01:00
|
|
|
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
|
2008-05-14 20:26:48 +01:00
|
|
|
|
2008-05-07 18:15:42 +01:00
|
|
|
/**
|
|
|
|
* Table Definition for remote_profile
|
|
|
|
*/
|
2008-09-26 17:18:24 +01:00
|
|
|
require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
|
2008-05-07 18:15:42 +01:00
|
|
|
|
2011-08-22 22:52:02 +01:00
|
|
|
class Remote_profile extends Managed_DataObject
|
2008-05-07 18:15:42 +01:00
|
|
|
{
|
|
|
|
###START_AUTOCODE
|
|
|
|
/* the code below is auto generated do not remove the above tag */
|
|
|
|
|
|
|
|
public $__table = 'remote_profile'; // table name
|
|
|
|
public $id; // int(4) primary_key not_null
|
2008-05-22 19:41:09 +01:00
|
|
|
public $uri; // varchar(255) unique_key
|
2010-09-28 22:42:18 +01:00
|
|
|
public $postnoticeurl; // varchar(255)
|
|
|
|
public $updateprofileurl; // varchar(255)
|
2008-05-07 18:15:42 +01:00
|
|
|
public $created; // datetime() not_null
|
|
|
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
|
|
|
|
|
|
|
/* the code above is auto generated do not remove the tag below */
|
|
|
|
###END_AUTOCODE
|
2010-09-28 22:42:18 +01:00
|
|
|
|
2009-11-25 22:10:55 +00:00
|
|
|
function hasRight($right)
|
|
|
|
{
|
|
|
|
$profile = Profile::staticGet($this->id);
|
|
|
|
if ($profile) {
|
|
|
|
return $profile->hasright($right);
|
|
|
|
} else {
|
2010-07-29 12:36:08 +01:00
|
|
|
// TRANS: Exception thrown when a right for a non-existing user profile is checked.
|
|
|
|
throw new Exception(_("Missing profile."));
|
2009-11-25 22:10:55 +00:00
|
|
|
}
|
|
|
|
}
|
2011-08-22 22:52:02 +01:00
|
|
|
|
|
|
|
public static function schemaDef()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
'description' => 'remote people (OMB)',
|
|
|
|
'fields' => array(
|
|
|
|
'id' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to profile table'),
|
|
|
|
'uri' => array('type' => 'varchar', 'length' => 255, 'description' => 'universally unique identifier, usually a tag URI'),
|
|
|
|
'postnoticeurl' => array('type' => 'varchar', 'length' => 255, 'description' => 'URL we use for posting notices'),
|
|
|
|
'updateprofileurl' => array('type' => 'varchar', 'length' => 255, 'description' => 'URL we use for updates to this profile'),
|
|
|
|
'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('id'),
|
|
|
|
'unique keys' => array(
|
|
|
|
'remote_profile_uri_key' => array('uri'),
|
|
|
|
),
|
|
|
|
'foreign keys' => array(
|
|
|
|
'remote_profile_id_fkey' => array('profile', array('id' => 'id')),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
2008-05-07 18:15:42 +01:00
|
|
|
}
|