]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/Foreign_subscription.php
Merge branch '1.0.x' into activity
[quix0rs-gnu-social.git] / classes / Foreign_subscription.php
1 <?php
2 /**
3  * Table Definition for foreign_subscription
4  */
5 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
6
7 class Foreign_subscription extends Managed_DataObject
8 {
9     ###START_AUTOCODE
10     /* the code below is auto generated do not remove the above tag */
11
12     public $__table = 'foreign_subscription';            // table name
13     public $service;                         // int(4)  primary_key not_null
14     public $subscriber;                      // int(4)  primary_key not_null
15     public $subscribed;                      // int(4)  primary_key not_null
16     public $created;                         // datetime()   not_null
17
18     /* Static get */
19     function staticGet($k,$v=null)
20     { return Memcached_DataObject::staticGet('Foreign_subscription',$k,$v); }
21
22     /* the code above is auto generated do not remove the tag below */
23     ###END_AUTOCODE
24
25     public static function schemaDef()
26     {
27         return array(
28
29             'fields' => array(
30                 'service' => array('type' => 'int', 'not null' => true, 'description' => 'service where relationship happens'),
31                 'subscriber' => array('type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'subscriber on foreign service'),
32                 'subscribed' => array('type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'subscribed user'),
33                 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
34             ),
35             'primary key' => array('service', 'subscriber', 'subscribed'),
36             'foreign keys' => array(
37                 'foreign_subscription_service_fkey' => array('foreign_service', array('service' => 'id')),
38                 'foreign_subscription_subscriber_fkey' => array('foreign_user', array('subscriber' => 'id', 'service' => 'service')),
39                 'foreign_subscription_subscribed_fkey' => array('foreign_user', array('subscribed' => 'id', 'service' => 'service')),
40             ),
41             'indexes' => array(
42                 'foreign_subscription_subscriber_idx' => array('service', 'subscriber'),
43                 'foreign_subscription_subscribed_idx' => array('service', 'subscribed'),
44             ),
45         );
46     }
47 }