Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\DynamicContentBundle\Event;
|
||||
|
||||
use Mautic\LeadBundle\Entity\Lead;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
final class ContactFiltersEvaluateEvent extends Event
|
||||
{
|
||||
private bool $isEvaluated = false;
|
||||
|
||||
private bool $isMatched = false;
|
||||
|
||||
/**
|
||||
* @param mixed[] $filters
|
||||
*/
|
||||
public function __construct(
|
||||
private array $filters,
|
||||
private Lead $contact,
|
||||
) {
|
||||
}
|
||||
|
||||
public function isMatch(): bool
|
||||
{
|
||||
return $this->isEvaluated() && $this->isMatched;
|
||||
}
|
||||
|
||||
public function isEvaluated(): bool
|
||||
{
|
||||
return $this->isEvaluated;
|
||||
}
|
||||
|
||||
public function setIsEvaluated(bool $evaluated): ContactFiltersEvaluateEvent
|
||||
{
|
||||
$this->isEvaluated = $evaluated;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getContact(): Lead
|
||||
{
|
||||
return $this->contact;
|
||||
}
|
||||
|
||||
public function setContact(Lead $contact): ContactFiltersEvaluateEvent
|
||||
{
|
||||
$this->contact = $contact;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed[]
|
||||
*/
|
||||
public function getFilters(): array
|
||||
{
|
||||
return $this->filters;
|
||||
}
|
||||
|
||||
public function isMatched(): bool
|
||||
{
|
||||
return $this->isMatched;
|
||||
}
|
||||
|
||||
public function setIsMatched(bool $isMatched): ContactFiltersEvaluateEvent
|
||||
{
|
||||
$this->isMatched = $isMatched;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\DynamicContentBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
use Mautic\DynamicContentBundle\Entity\DynamicContent;
|
||||
|
||||
class DynamicContentEvent extends CommonEvent
|
||||
{
|
||||
/**
|
||||
* @param bool $isNew
|
||||
*/
|
||||
public function __construct(DynamicContent $entity, $isNew = false)
|
||||
{
|
||||
$this->entity = $entity;
|
||||
$this->isNew = $isNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return DynamicContent
|
||||
*/
|
||||
public function getDynamicContent()
|
||||
{
|
||||
return $this->entity;
|
||||
}
|
||||
|
||||
public function setDynamicContent(DynamicContent $entity): void
|
||||
{
|
||||
$this->entity = $entity;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user