- md5
- 305fcdcd4d3c15c9ef8697050dce72cc
- sha1
- ea6fe50c446cd36970f268bb96e355c33acd402c
- sha256
- 33f66723f95bcb4c20a9281732e65f74655863f8a4581628d7e38d060765825b
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
<?php
/**
* Joomla! Content Management System
*
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Event\Plugin\System\Schemaorg;
use Joomla\CMS\Event\AbstractImmutableEvent;
use Joomla\CMS\Form\Form;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Class for SchemaPrepareFormEvent event
* Example:
* new PrepareFormEvent('onSchemaPrepareForm', ['subject' => $form]);
*
* @since 5.0.0
*/
class PrepareFormEvent extends AbstractImmutableEvent
{
/**
* Constructor.
*
* @param string $name The event name.
* @param array $arguments The event arguments.
*
* @throws \BadMethodCallException
*
* @since 5.0.0
*/
public function __construct($name, array $arguments = [])
{
if (!\array_key_exists('subject', $arguments)) {
throw new \BadMethodCallException("Argument 'subject' of event {$name} is required but has not been provided");
}
parent::__construct($name, $arguments);
}
/**
* Setter for the subject argument.
*
* @param Form $value The value to set
*
* @return Form
*
* @since 5.0.0
*/
protected function setSubject(Form $value): Form
{
return $value;
}
/**
* Getter for the form argument.
*
* @return Form
*
* @since 5.0.0
*/
public function getForm(): Form
{
return $this->arguments['subject'];
}
}
The same content is in 3 releases, Joomla 5.0.0-alpha4 to 5.0.0-beta2. See them all, or every version of this file.