aboutsummaryrefslogtreecommitdiff
path: root/lib/classes/visibility/VisibilityAbstract.php
blob: 2eb5172b4561614f3d1344a811f26c6ca95c33f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
 * VisibilityAbstract.php - Abstract class to define a visibilitySetting
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * @author      Florian Bieringer <florian.bieringer@uni-passau.de>
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
 * @category    Stud.IP
 */

/**
 * Defines basic attributes and functions a visibilitySetting needs
 */
abstract class VisibilityAbstract
{
    protected $activated;
    protected $int_representation;
    protected $display_name;
    protected $description;

    /**
     * verify method to determine if 2 users satisfy the criteria
     * @param string $user_id the owner of the visibility
     * @param string $other_id the user who gets checked if he can see the
     * selected object
     * @abstract
     */
    abstract function verify($user_id, $other_id);

    /**
     * Returns if a visibiltySetting is activated
     *
     * @return boolean true if the visibilitySetting is activated
     */
    public function isActivated()
    {
        return $this->activated;
    }

    /**
     * Returns the int representation of the visibilitySetting in the database
     *
     * @return int the visibilitySetting in the database
     */
    public function getIntRepresentation()
    {
        return $this->int_representation;
    }

    /**
     * Returns the displayname of a visibilitySetting
     *
     * @return string the displayname
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Returns the description of a visibilitySetting
     *
     * @return string  description of the visibilitySetting
     */
    public function getDescription()
    {
        return $this->description;
    }

}

?>