Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace MauticPlugin\MauticSocialBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
use MauticPlugin\MauticSocialBundle\Entity\Monitoring;
|
||||
|
||||
class SocialEvent extends CommonEvent
|
||||
{
|
||||
/**
|
||||
* @param bool $isNew
|
||||
*/
|
||||
public function __construct(Monitoring $monitoring, $isNew = false)
|
||||
{
|
||||
$this->entity = $monitoring;
|
||||
$this->isNew = $isNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Monitoring entity.
|
||||
*
|
||||
* @return Monitoring
|
||||
*/
|
||||
public function getMonitoring()
|
||||
{
|
||||
return $this->entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Monitoring entity.
|
||||
*/
|
||||
public function setMonitoring(Monitoring $monitoring): void
|
||||
{
|
||||
$this->entity = $monitoring;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace MauticPlugin\MauticSocialBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
use MauticPlugin\MauticSocialBundle\Entity\Monitoring;
|
||||
|
||||
class SocialMonitorEvent extends CommonEvent
|
||||
{
|
||||
protected int $newLeadCount;
|
||||
|
||||
protected int $updatedLeadCount;
|
||||
|
||||
/**
|
||||
* @param string $integrationName
|
||||
* @param int $newLeadCount
|
||||
* @param int $updatedLeadCount
|
||||
*/
|
||||
public function __construct(
|
||||
protected $integrationName,
|
||||
Monitoring $monitoring,
|
||||
protected array $leadIds,
|
||||
$newLeadCount,
|
||||
$updatedLeadCount,
|
||||
) {
|
||||
$this->entity = $monitoring;
|
||||
$this->newLeadCount = (int) $newLeadCount;
|
||||
$this->updatedLeadCount = (int) $updatedLeadCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Monitoring entity.
|
||||
*
|
||||
* @return Monitoring
|
||||
*/
|
||||
public function getMonitoring()
|
||||
{
|
||||
return $this->entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get count of new leads.
|
||||
*/
|
||||
public function getNewLeadCount(): int
|
||||
{
|
||||
return $this->newLeadCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get count of updated leads.
|
||||
*/
|
||||
public function getUpdatedLeadCount(): int
|
||||
{
|
||||
return $this->updatedLeadCount;
|
||||
}
|
||||
|
||||
public function getTotalLeadCount(): int
|
||||
{
|
||||
return $this->updatedLeadCount + $this->newLeadCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getLeadIds()
|
||||
{
|
||||
return $this->leadIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getIntegrationName()
|
||||
{
|
||||
return $this->integrationName;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user