-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsubscribable.php
More file actions
141 lines (127 loc) · 2.77 KB
/
Copy pathsubscribable.php
File metadata and controls
141 lines (127 loc) · 2.77 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
/**
* Interface for lists: things that can be subscribed to.
*
* @since 2.0.0 Added named language phrases
* @since 1.0.0
*
*/
interface Prompt_Interface_Subscribable extends Prompt_Interface_Identifiable {
/**
* Get the user IDs of all subscribers to this object.
*
* @since 1.0.0
*
* @return array
*/
function subscriber_ids();
/**
* Determine whether a user is subscribed to this object.
*
* @since 1.0.0
*
* @param $user_id
* @return mixed
*/
function is_subscribed( $user_id );
/**
* Ensure that a user is subscribed to this object.
*
* Do nothing if the user is already subscribed.
*
* @since 1.0.0
*
* @param int $user_id
* @return Prompt_Interface_Subscribable A reference to this object.
*/
function subscribe( $user_id );
/**
* Unsubscribe a user from this object.
*
* @since 1.0.0
*
* @param int $user_id
* @return Prompt_Interface_Subscribable A reference to this object.
*/
function unsubscribe( $user_id );
/**
* An URL representing the list.
*
* @since 1.0.0
*
* @return string
*/
function subscription_url();
/**
* A title.
*
* @since 2.0.0 Added format parameter
* @since 1.0.0
*
* @param string $format 'html' or 'text', default 'html'.
* @return string
*/
function subscription_object_label( $format = Prompt_Enum_Content_Types::HTML );
/**
* A confirmation message.
*
* @since 2.0.0 Added format parameter
* @since 1.0.0
*
* @param string $format 'html' or 'text', default 'html'.
* @return string
*/
function subscription_description( $format = Prompt_Enum_Content_Types::HTML );
/**
* A prompt phrase to select this list in an email reply.
*
* @since 2.0.0
*
* @param string $format 'html' or 'text', default 'html'.
* @return string
*/
function select_reply_prompt( $format = Prompt_Enum_Content_Types::HTML );
/**
* A phrase for a toggle-style interface inviting a user to join this list.
*
* @since 2.0.0
*
* @param string $format 'html' or 'text', default 'html'.
* @return string
*/
function subscribe_prompt( $format = Prompt_Enum_Content_Types::HTML );
/**
* A phrase that can be used to identify this list in a reply command.
*
* @since 2.0.0
*
* @return string
*/
function subscribe_phrase();
/**
* Whether given text matches the subscribe phrase.
*
* @since 2.0.0
*
* @param string $text
* @return string
*/
function matches_subscribe_phrase( $text );
/**
* Get the IDs of all objects a user is subscribed to.
*
* @since 1.0.0
*
* @param $user_id
* @return array
*/
static function subscribed_object_ids( $user_id );
/**
* Get the IDs of all users with subscriptions to this type of object.
*
* @since 1.0.0
*
* @return array
*/
static function all_subscriber_ids();
}