This commit is contained in:
PaulCombal 2019-03-01 13:19:12 +01:00
parent 3b9c194e51
commit ec25a021ba
2 changed files with 22 additions and 19 deletions

View File

@ -2,16 +2,21 @@
namespace Bluesquare\NotificationsBundle\Controller; namespace Bluesquare\NotificationsBundle\Controller;
use Bluesquare\NotificationsBundle\Service\FooService; use Bluesquare\NotificationsBundle\Service\NotificationsService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
class MainController extends AbstractController class MainController extends AbstractController
{ {
/**
* @param Request $request
*/
public function index(Request $request) public function index(Request $request)
{ {
// ON PEUT PAS INJECTER UN SERVICE DU BUNDLE EN QUESTION DANS LES ARGS DONC ON LE récupère ainsi : // ON PEUT PAS INJECTER UN SERVICE DU BUNDLE EN QUESTION DANS LES ARGS DONC ON LE récupère ainsi :
$r = $this->get('bluesquare.notifications_bundle.notifssrv')->foo(); /** @var NotificationsService $notifssrv */
$notifssrv = $this->get('bluesquare.notifications_bundle.notifssrv');
$r = $notifssrv->notifyUsers();
die($r); die($r);
} }
} }

View File

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
/** /**
* @ORM\Entity(repositoryClass="Bluesquare\NotificationsBundle\Repository\BillingInvoiceRepository") * @ORM\Entity(repositoryClass="Bluesquare\NotificationsBundle\Repository\BillingInvoiceRepository")
*/ */
class BillingInvoice class Notification
{ {
/** /**
* @ORM\Id() * @ORM\Id()
@ -17,24 +17,22 @@ class BillingInvoice
private $id; private $id;
/** /**
* @ORM\Column(type="string", length=255) * @ORM\Column(type="string", length=191)
*/ */
private $azerty; private $title;
public function getId(): ?int /**
{ * @ORM\Column(type="string", length=191)
return $this->id; */
} private $data;
public function getAzerty(): ?string /**
{ * @ORM\Column(type="string", length=191)
return $this->azerty; */
} private $description;
public function setAzerty(string $azerty): self /**
{ * @ORM\ManyToOne(targetEntity="User")
$this->azerty = $azerty; */
private $user;
return $this;
}
} }