1 | <?php |
||
23 | class ForumThreadSubscription extends DataObject |
||
24 | { |
||
25 | /** @var array */ |
||
26 | private static $db = array( |
||
27 | "LastSent" => "Datetime" |
||
28 | ); |
||
29 | |||
30 | /** @var array */ |
||
31 | private static $has_one = array( |
||
32 | "Thread" => ForumThread::class, |
||
33 | "Member" => Member::class |
||
34 | ); |
||
35 | |||
36 | /** |
||
37 | * Checks to see if a Member is already subscribed to this thread |
||
38 | * |
||
39 | * @param int $threadID The ID of the thread to check |
||
40 | * @param int $memberID The ID of the currently logged in member (Defaults to Member::currentUserID()) |
||
41 | * |
||
42 | * @return bool true if they are subscribed, false if they're not |
||
43 | */ |
||
44 | public static function alreadySubscribed($threadID, $memberID = null) |
||
64 | |||
65 | /** |
||
66 | * Notifies everybody that has subscribed to this topic that a new post has been added. |
||
67 | * To get emailed, people subscribed to this topic must have visited the forum |
||
68 | * since the last time they received an email |
||
69 | * |
||
70 | * @param Post $post The post that has just been added |
||
71 | */ |
||
72 | public static function notify(Post $post) |
||
109 | |||
110 | } |
||
111 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: