Foreign_subscription.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Table Definition for foreign_subscription
  4. */
  5. require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
  6. class Foreign_subscription extends Managed_DataObject
  7. {
  8. ###START_AUTOCODE
  9. /* the code below is auto generated do not remove the above tag */
  10. public $__table = 'foreign_subscription'; // table name
  11. public $service; // int(4) primary_key not_null
  12. public $subscriber; // int(4) primary_key not_null
  13. public $subscribed; // int(4) primary_key not_null
  14. public $created; // datetime() not_null default_0000-00-00%2000%3A00%3A00
  15. /* the code above is auto generated do not remove the tag below */
  16. ###END_AUTOCODE
  17. public static function schemaDef()
  18. {
  19. return array(
  20. 'fields' => array(
  21. 'service' => array('type' => 'int', 'not null' => true, 'description' => 'service where relationship happens'),
  22. 'subscriber' => array('type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'subscriber on foreign service'),
  23. 'subscribed' => array('type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'subscribed user'),
  24. 'created' => array('type' => 'datetime', 'not null' => true, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'),
  25. ),
  26. 'primary key' => array('service', 'subscriber', 'subscribed'),
  27. 'foreign keys' => array(
  28. 'foreign_subscription_service_fkey' => array('foreign_service', array('service' => 'id')),
  29. 'foreign_subscription_subscriber_fkey' => array('foreign_user', array('subscriber' => 'id', 'service' => 'service')),
  30. 'foreign_subscription_subscribed_fkey' => array('foreign_user', array('subscribed' => 'id', 'service' => 'service')),
  31. ),
  32. 'indexes' => array(
  33. 'foreign_subscription_subscriber_idx' => array('service', 'subscriber'),
  34. 'foreign_subscription_subscribed_idx' => array('service', 'subscribed'),
  35. ),
  36. );
  37. }
  38. }