- md5
- 882850795177c4ee890098f0cd84c088
- sha1
- f07dc3cc48061b14ed708de500a48d7aa8a417f0
- sha256
- fc3f5a1d6f8033b30b4ad5da44ed31d13b9176e5b759082cf9a3e98842d29241
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
<?php
/**
* Joomla! Content Management System
*
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\CMS\Event\MultiFactor;
use DomainException;
use Joomla\CMS\Event\AbstractImmutableEvent;
use Joomla\CMS\Event\Result\ResultAware;
use Joomla\CMS\Event\Result\ResultAwareInterface;
use Joomla\CMS\Event\Result\ResultTypeObjectAware;
use Joomla\Component\Users\Administrator\DataShape\SetupRenderOptions;
use Joomla\Component\Users\Administrator\Table\MfaTable;
/**
* Concrete Event class for the onUserMultifactorGetSetup event
*
* @since 4.2.0
*/
class GetSetup extends AbstractImmutableEvent implements ResultAwareInterface
{
use ResultAware;
use ResultTypeObjectAware;
/**
* Public constructor
*
* @param MfaTable $record The record to display the setup page for
*
* @since 4.2.0
*/
public function __construct(MfaTable $record)
{
parent::__construct('onUserMultifactorGetSetup', ['record' => $record]);
$this->resultIsNullable = true;
$this->resultAcceptableClasses = [
SetupRenderOptions::class,
];
}
/**
* Validate the value of the 'record' named parameter
*
* @param MfaTable $value The value to validate
*
* @return MfaTable
* @since 4.2.0
*/
public function setRecord(MfaTable $value): MfaTable
{
if (empty($value)) {
throw new DomainException(sprintf('Argument \'record\' of event %s must be a MfaTable object.', $this->name));
}
return $value;
}
}
The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.