Add promo logger service. #558

This commit is contained in:
Korina Cordero 2021-05-10 03:36:54 +00:00
parent 03360a2ae9
commit d99bfedb01

View file

@ -0,0 +1,34 @@
<?php
namespace App\Service;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\PromoLog;
class PromoLogger
{
protected $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
public function logPromoInfo($created_by, $cust_id, $cust_fname, $cust_lname, $jo_id,
$invoice_id, $amount)
{
$log_entry = new PromoLog();
$log_entry->setCreatedBy($created_by)
->setCustId($cust_id)
->setCustFirstName($cust_fname)
->setCustLastName($cust_lname)
->setJoId($jo_id)
->setInvoiceId($invoice_id)
->setAmount($amount);
$this->em->persist($log_entry);
$this->em->flush();
}
}