mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 22:09:29 +00:00
30 lines
451 B
PHP
30 lines
451 B
PHP
|
<?php
|
||
|
/**
|
||
|
* Notifications REST controller
|
||
|
*
|
||
|
* @author Pierre HUBERT
|
||
|
*/
|
||
|
|
||
|
class notificationsController {
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Get the number of unread notifications of a user
|
||
|
*
|
||
|
* @url POST notifications/count_unread
|
||
|
*/
|
||
|
public function count_unread(){
|
||
|
|
||
|
user_login_required();
|
||
|
|
||
|
//Get the number of unread notifications
|
||
|
$number = components()->notifications->count_unread(userID);
|
||
|
|
||
|
//Return it
|
||
|
return array(
|
||
|
"number" => $number
|
||
|
);
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|