Création du module PurgeFakeCustomer
This commit is contained in:
83
local/modules/PurgeFakeCustomer/Event/FakeCustomerEvent.php
Normal file
83
local/modules/PurgeFakeCustomer/Event/FakeCustomerEvent.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace PurgeFakeCustomer\Event;
|
||||
|
||||
use Thelia\Core\Event\ActionEvent;
|
||||
|
||||
class FakeCustomerEvent extends ActionEvent
|
||||
{
|
||||
const PURGE = 'purgefakecustomer.purge';
|
||||
|
||||
/* Critère de purge des faux clients */
|
||||
protected $critere;
|
||||
|
||||
/** @var string[] */
|
||||
protected $status = [];
|
||||
|
||||
/** @var bool */
|
||||
protected $verbose;
|
||||
|
||||
/** @var int */
|
||||
protected $deletedCount = 0;
|
||||
|
||||
/**
|
||||
* FakeCustomerEvent constructor.
|
||||
*/
|
||||
public function __construct($critere, $verbose = false)
|
||||
{
|
||||
$this->critere = $critere;
|
||||
$this->verbose = $verbose;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCritere()
|
||||
{
|
||||
return $this->critere;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $status
|
||||
* @return $this
|
||||
*/
|
||||
public function appendStatus($status, $level = 'info')
|
||||
{
|
||||
$this->status[$status] = $level;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
*/
|
||||
public function isVerbose()
|
||||
{
|
||||
return $this->verbose;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDeletedCount()
|
||||
{
|
||||
return $this->deletedCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $deletedCount
|
||||
* @return $this
|
||||
*/
|
||||
public function setDeletedCount($deletedCount)
|
||||
{
|
||||
$this->deletedCount = $deletedCount;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user