auto
This commit is contained in:
parent
149d6d47d9
commit
f3ad257ca6
|
@ -1,3 +1,4 @@
|
|||
.idea/
|
||||
vendor/
|
||||
.DS_Store
|
||||
composer.lock
|
||||
|
|
|
@ -51,8 +51,8 @@ class NotificationsService
|
|||
}
|
||||
|
||||
/**
|
||||
* Little shortcut to get all notification for a user
|
||||
* This way you don't need to have a mnager or import notification.
|
||||
* Little shortcut to get all of a user's notifications
|
||||
* This way you don't need to have a manager or import the Notification class.
|
||||
*
|
||||
* If you want the return value to be associative arrays, set assoc to true
|
||||
*
|
||||
|
|
25
README.md
25
README.md
|
@ -64,4 +64,27 @@ Méthdodes:
|
|||
|
||||
## Entités
|
||||
|
||||
* Notification: représente une notification pour un seul utilisateur
|
||||
* Notification: représente une notification pour un seul utilisateur
|
||||
|
||||
## Exemple
|
||||
|
||||
Exemple pour notifier des users:
|
||||
|
||||
```php
|
||||
$notif = new Notification();
|
||||
$notif->setTitle("Bonjour");
|
||||
$notif->setDescription("Skippy vous attend dans son antre");
|
||||
$notif->setData("le_nom_de_la_route_en_react");
|
||||
|
||||
$users = [$user]; // Peut contenir plein d'users
|
||||
$notifssrv->notifyUsers($users, $notif);
|
||||
```
|
||||
Pas besoin de persist la notification créée, le service se charge de perist tous les clones
|
||||
créés pour chacun des users.
|
||||
|
||||
|
||||
Les notifications devront être retouvées côté client avec le endpoint `/get`, qui n'est
|
||||
qu'une interface pour:
|
||||
```php
|
||||
$notifssrv->getForUser($this->getUser());
|
||||
```
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "71470e0f0c2bb3d0849e24978e4ee684",
|
||||
"packages": [],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"platform-dev": []
|
||||
}
|
Loading…
Reference in New Issue