123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
- require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
- class Profile_block extends Managed_DataObject
- {
-
-
- public $__table = 'profile_block';
- public $blocker;
- public $blocked;
- public $modified;
-
-
- public static function schemaDef()
- {
- return array(
- 'fields' => array(
- 'blocker' => array('type' => 'int', 'not null' => true, 'description' => 'user making the block'),
- 'blocked' => array('type' => 'int', 'not null' => true, 'description' => 'profile that is blocked'),
- 'modified' => array('type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date of blocking'),
- ),
- 'foreign keys' => array(
- 'profile_block_blocker_fkey' => array('user', array('blocker' => 'id')),
- 'profile_block_blocked_fkey' => array('profile', array('blocked' => 'id')),
- ),
- 'primary key' => array('blocker', 'blocked'),
- );
- }
- static function exists(Profile $blocker, Profile $blocked)
- {
- return Profile_block::pkeyGet(array('blocker' => $blocker->id,
- 'blocked' => $blocked->id));
- }
- }
|