~bshanks/+junk/statusnet-profile-attrs

« back to all changes in this revision

Viewing changes to User_attribute_permissions.php

  • Committer: bshanks
  • Date: 2010-05-11 22:17:28 UTC
  • Revision ID: bshanks-20100511221728-vop7yguj0gzrhtrb
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Data class for profile attributes
 
4
 *
 
5
 * PHP version 5
 
6
 *
 
7
 * @category Data
 
8
 * @package  StatusNet
 
9
 * @author   Bayle Shanks
 
10
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
 
11
 * @link     http://status.net/
 
12
 *
 
13
 * Copyright (C) 2010 Bayle Shanks.
 
14
 *
 
15
 * This program is free software: you can redistribute it and/or modify
 
16
 * it under the terms of the GNU Affero General Public License as published by
 
17
 * the Free Software Foundation, either version 3 of the License, or
 
18
 * (at your option) any later version.
 
19
 *
 
20
 * This program is distributed in the hope that it will be useful,
 
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the
 
23
 * GNU Affero General Public License for more details.
 
24
 *
 
25
 * You should have received a copy of the GNU Affero General Public License
 
26
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 
27
 */
 
28
 
 
29
if (!defined('STATUSNET')) {
 
30
    exit(1);
 
31
}
 
32
 
 
33
class User_attribute_permissions extends Attribute_tables {
 
34
    public $__table = 'user_attribute_permissions';               // table name
 
35
 
 
36
    static function getAllAttributeItems($user_id, $attribute) {
 
37
      return parent::getAllAttributeItems('User_attribute_permissions', $user_id, $attribute);}
 
38
 
 
39
 
 
40
    static function getAllAttributeItemsSorted($user_id, $attribute) {
 
41
      return parent::getAllAttributeItemsSorted('User_attribute_permissions', $user_id, $attribute);}
 
42
 
 
43
 
 
44
    static function newinit($user_id, $attribute, $value, $type) {
 
45
      return parent::newinit('User_attribute_permissions', $user_id, $attribute, $value, $type);
 
46
    }  
 
47
 
 
48
 
 
49
    static function newInitInsert($user_id, $attribute, $value, $type) {
 
50
      return parent::newInitInsert('User_attribute_permissions', $user_id, $attribute, $value, $type);
 
51
    }
 
52
 
 
53
 
 
54
    static function addToAttribute($user_id, $attribute, $value, $type)  {
 
55
      return parent::addToAttribute('User_attribute_permissions', $user_id, $attribute, $value, $type);
 
56
    }
 
57
 
 
58
 
 
59
    static function deleteAttribute($user_id, $attribute, $value, $type) {
 
60
      return parent::deleteAttribute('User_attribute_permissions', $user_id, $attribute, $value, $type);
 
61
    }
 
62
 
 
63
    static function deleteAllAttributeValues($classname, $user_id, $attribute) {
 
64
      parent::deleteAllAttributeValues('User_attribute_permissions', $user_id, $attribute);
 
65
    }
 
66
 
 
67
    static function replaceAllAttributeValues($user_id, $attribute, $type, $newValue=null) {
 
68
      return parent::replaceAllAttributeValues('User_attribute_permissions', $user_id, $attribute, $type, $newValue);
 
69
    }
 
70
 
 
71
    static function isIn($user_id, $attribute, $type, $value) {
 
72
      return parent::isIn('User_attribute_permissions', $user_id, $attribute, $type, $value);
 
73
    }
 
74
 
 
75
    static function getAllUserItems($user_id) {
 
76
       return parent::getAllUserItems('User_attribute_permissions', $user_id);
 
77
    }
 
78
 
 
79
    static function getAllUserItemsSorted($user_id)
 
80
      {return parent::getAllUserItemsSorted('User_attribute_permissions', $user_id);}
 
81
 
 
82
}