mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-12-26 05:28:57 +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
|
||
|
);
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|