Add promo logger service. #558
This commit is contained in:
parent
03360a2ae9
commit
d99bfedb01
1 changed files with 34 additions and 0 deletions
34
src/Service/PromoLogger.php
Normal file
34
src/Service/PromoLogger.php
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue