[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * Joomla! Content Management System 5 * 6 * @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org> 7 * @license GNU General Public License version 2 or later; see LICENSE 8 */ 9 10 namespace Joomla\CMS\Event\MultiFactor; 11 12 use DomainException; 13 use Joomla\CMS\Event\AbstractImmutableEvent; 14 use Joomla\CMS\Event\Result\ResultAware; 15 use Joomla\CMS\User\User; 16 17 // phpcs:disable PSR1.Files.SideEffects 18 \defined('JPATH_PLATFORM') or die; 19 // phpcs:enable PSR1.Files.SideEffects 20 21 /** 22 * Concrete Event class for the onUserMultifactorBeforeDisplayMethods event 23 * 24 * @since 4.2.0 25 */ 26 class BeforeDisplayMethods extends AbstractImmutableEvent 27 { 28 use ResultAware; 29 30 /** 31 * Public constructor 32 * 33 * @param User $user The user the MFA methods are displayed for 34 * 35 * @since 4.2.0 36 */ 37 public function __construct(User $user) 38 { 39 parent::__construct('onUserMultifactorBeforeDisplayMethods', ['user' => $user]); 40 } 41 42 /** 43 * Validate the value of the 'user' named parameter 44 * 45 * @param User $value The value to validate 46 * 47 * @return User 48 * @since 4.2.0 49 */ 50 public function setUser(User $value): User 51 { 52 if (empty($value) || ($value->id <= 0) || ($value->guest == 1)) { 53 throw new DomainException(sprintf('Argument \'user\' of event %s must be a non-guest User object.', $this->name)); 54 } 55 56 return $value; 57 } 58 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |