Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\AssetBundle\Event;
|
||||
|
||||
use Mautic\AssetBundle\Entity\Asset;
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
|
||||
class AssetEvent extends CommonEvent
|
||||
{
|
||||
/**
|
||||
* @param bool $isNew
|
||||
*/
|
||||
public function __construct(Asset $asset, $isNew = false)
|
||||
{
|
||||
$this->entity = $asset;
|
||||
$this->isNew = $isNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Asset entity.
|
||||
*
|
||||
* @return Asset
|
||||
*/
|
||||
public function getAsset()
|
||||
{
|
||||
return $this->entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the Asset entity.
|
||||
*/
|
||||
public function setAsset(Asset $asset): void
|
||||
{
|
||||
$this->entity = $asset;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\AssetBundle\Event;
|
||||
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
|
||||
final class AssetExportListEvent extends CommonEvent
|
||||
{
|
||||
/**
|
||||
* @var array<string>
|
||||
*/
|
||||
private array $list = [];
|
||||
|
||||
/**
|
||||
* @param list<array<string, array<string, mixed>>> $data
|
||||
*/
|
||||
public function __construct(private array $data)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<array<string, array<string, mixed>>>
|
||||
*/
|
||||
public function getEntityData(): array
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
public function setList(string $item): void
|
||||
{
|
||||
if (!in_array($item, $this->list)) {
|
||||
$this->list[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string>|null
|
||||
*/
|
||||
public function getList(): ?array
|
||||
{
|
||||
return $this->list ?? null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\AssetBundle\Event;
|
||||
|
||||
use Mautic\AssetBundle\Entity\Download;
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
|
||||
class AssetLoadEvent extends CommonEvent
|
||||
{
|
||||
public function __construct(
|
||||
Download $download,
|
||||
protected bool $unique,
|
||||
) {
|
||||
$this->entity = $download;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Download entity.
|
||||
*
|
||||
* @return Download
|
||||
*/
|
||||
public function getRecord()
|
||||
{
|
||||
return $this->entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Mautic\AssetBundle\Entity\Asset
|
||||
*/
|
||||
public function getAsset()
|
||||
{
|
||||
return $this->entity->getAsset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if this is the first download for the session.
|
||||
*/
|
||||
public function isUnique(): bool
|
||||
{
|
||||
return $this->unique;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace Mautic\AssetBundle\Event;
|
||||
|
||||
use Gaufrette\Adapter;
|
||||
use Mautic\CoreBundle\Event\CommonEvent;
|
||||
use Mautic\PluginBundle\Integration\UnifiedIntegrationInterface;
|
||||
|
||||
class RemoteAssetBrowseEvent extends CommonEvent
|
||||
{
|
||||
private ?Adapter $adapter = null;
|
||||
private ?string $failureMessage = null;
|
||||
|
||||
public function __construct(
|
||||
private UnifiedIntegrationInterface $integration,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getAdapter(): ?Adapter
|
||||
{
|
||||
return $this->adapter;
|
||||
}
|
||||
|
||||
public function getIntegration(): UnifiedIntegrationInterface
|
||||
{
|
||||
return $this->integration;
|
||||
}
|
||||
|
||||
public function setAdapter(Adapter $adapter): void
|
||||
{
|
||||
$this->adapter = $adapter;
|
||||
}
|
||||
|
||||
public function setFailed(string $message): void
|
||||
{
|
||||
$this->failureMessage = $message;
|
||||
}
|
||||
|
||||
public function getFailureMessage(): ?string
|
||||
{
|
||||
return $this->failureMessage;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user