CoreFiles by mySites.guru
GetSetup.php65 lines, 1,602 bytes, from Joomla_4.2.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.2.0-beta1
md5
d625110d5307bdb9de5e4521a93e2480
sha1
3206fcae6cf31f0b71508369ee3e407ed32fe3a8
sha256
d9d821d71cbc3ec8da6a6e89abe8457961ba708cded6cf0e381c36459537e031
<?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;

\defined('JPATH_PLATFORM') or die;

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 2 releases, Joomla 4.2.0-beta1 to 4.2.0-beta2. See them all, or every version of this file.