PHP code example of jamesi / notification-bundle

1. Go to this page and download the library: Download jamesi/notification-bundle 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/ */

    

jamesi / notification-bundle example snippets

 php
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Jamesi\NotificationBundle\JamesiNotificationBundle(),
    }
 php
    public function getNotificationName()
    {
        // Who should the email be addressed to?
        return $this->getUsername();
    }

    public function getNotificationEmail()
    {
        // Who should the email be addressed to?
        return $this->getEmail();
    }

    public function acceptsNotificationAlert($type)
    {
        // Implement logic here for which on-site alerts the user wants
        return true;
    }

    public function acceptsNotificationEmail($type)
    {
        // Implement logic here for unsubscribing from types of email notification
        return true;
    }
 php


namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Jamesi\NotificationBundle\Entity\Alert as BaseAlert;

/**
 * @ORM\Entity
 * @ORM\Table(name="alert")
 */
class Alert extends BaseAlert
{
    /**
     * @var int
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @var User
     * @ORM\ManyToOne(targetEntity="User")
     */
    protected $user;
}