resq/src/Service/PromoLogger.php
2021-05-10 03:36:54 +00:00

34 lines
775 B
PHP

<?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();
}
}