This commit is contained in:
PaulCombal 2019-03-01 13:24:58 +01:00
parent ec25a021ba
commit f71e5cc158
5 changed files with 203 additions and 90 deletions

View File

@ -1,38 +0,0 @@
<?php
namespace Bluesquare\NotificationsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="Bluesquare\NotificationsBundle\Repository\BillingInvoiceRepository")
*/
class Notification
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=191)
*/
private $title;
/**
* @ORM\Column(type="string", length=191)
*/
private $data;
/**
* @ORM\Column(type="string", length=191)
*/
private $description;
/**
* @ORM\ManyToOne(targetEntity="User")
*/
private $user;
}

View File

@ -0,0 +1,182 @@
<?php
namespace Bluesquare\NotificationsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="Bluesquare\NotificationsBundle\Repository\NotificationRepository")
*/
class Notification
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=191)
*/
private $title;
/**
* @ORM\Column(type="string", length=191)
*/
private $data;
/**
* @ORM\Column(type="string", length=191)
*/
private $description;
/**
* @ORM\ManyToOne(targetEntity="User")
*/
private $user;
/**
* @ORM\Column(type="datetime")
*/
private $deleted_at;
/**
* @ORM\Column(type="datetime")
*/
private $seen_at;
// =================================
// ========GETTERS/SETTERS==========
// =================================
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
* @return Notification
*/
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* @return mixed
*/
public function getTitle()
{
return $this->title;
}
/**
* @param mixed $title
* @return Notification
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* @return mixed
*/
public function getData()
{
return $this->data;
}
/**
* @param mixed $data
* @return Notification
*/
public function setData($data)
{
$this->data = $data;
return $this;
}
/**
* @return mixed
*/
public function getDescription()
{
return $this->description;
}
/**
* @param mixed $description
* @return Notification
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* @return mixed
*/
public function getUser()
{
return $this->user;
}
/**
* @param mixed $user
* @return Notification
*/
public function setUser($user)
{
$this->user = $user;
return $this;
}
/**
* @return mixed
*/
public function getDeletedAt()
{
return $this->deleted_at;
}
/**
* @param mixed $deleted_at
* @return Notification
*/
public function setDeletedAt($deleted_at)
{
$this->deleted_at = $deleted_at;
return $this;
}
/**
* @return mixed
*/
public function getSeenAt()
{
return $this->seen_at;
}
/**
* @param mixed $seen_at
* @return Notification
*/
public function setSeenAt($seen_at)
{
$this->seen_at = $seen_at;
return $this;
}
}

View File

@ -2,8 +2,6 @@
namespace Bluesquare\NotificationsBundle;
use Bluesquare\NotificationsBundle\Entity\BillingInvoice;
use Bluesquare\NotificationsBundle\Repository\BillingInvoiceRepository;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Bluesquare\NotificationsBundle\DependencyInjection\NotificationsExtension;
use Symfony\Component\HttpKernel\Bundle\Bundle;

View File

@ -1,50 +0,0 @@
<?php
namespace Bluesquare\NotificationsBundle\Repository;
use Bluesquare\NotificationsBundle\Entity\BillingInvoice;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method BillingInvoice|null find($id, $lockMode = null, $lockVersion = null)
* @method BillingInvoice|null findOneBy(array $criteria, array $orderBy = null)
* @method BillingInvoice[] findAll()
* @method BillingInvoice[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class BillingInvoiceRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, BillingInvoice::class);
}
// /**
// * @return BillingInvoice[] Returns an array of BillingInvoice objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('b')
->andWhere('b.exampleField = :val')
->setParameter('val', $value)
->orderBy('b.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?BillingInvoice
{
return $this->createQueryBuilder('b')
->andWhere('b.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}

View File

@ -0,0 +1,21 @@
<?php
namespace Bluesquare\NotificationsBundle\Repository;
use Bluesquare\NotificationsBundle\Entity\Notification;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method Notification|null find($id, $lockMode = null, $lockVersion = null)
* @method Notification|null findOneBy(array $criteria, array $orderBy = null)
* @method Notification[] findAll()
* @method Notification[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class NotificationRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, Notification::class);
}
}