Files
CloudOps/docker-compose/mautic-setup/mautic-backup-files/docroot/app/bundles/AssetBundle/Event/AssetLoadEvent.php

43 lines
779 B
PHP
Executable File

<?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;
}
}