PHP code example of divante-ltd / pimcore5-notifications

1. Go to this page and download the library: Download divante-ltd/pimcore5-notifications library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

divante-ltd / pimcore5-notifications example snippets




use Divante\NotificationsBundle\Model\Notification;

$notification = new Notification();
$notification->setTitle('your title');
$notification->setMessage('your message');
$notification->setUser($user);
$notification->setType(Notification::TYPE_INFO); // optional
$notification->setFromUser($fromUser); // optional
$notification->setLinkedElement($linkedElement); // optional
$notification->save();