- md5
- ae482f579034035faa9f6cb6eceb9ec4
- sha1
- 3ed7f385bfa2ad65c67fd1ef83063c879a778cbb
- sha256
- 30ba5845570ea2c834b1f5d046e951263fda03455c3bfc7921a1f4a889439a1b
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
<?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\Model;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Class for Model Form event.
* Example:
* new BeforeValidateDataEvent('onEventName', ['subject' => $form, 'data' => $data]);
*
* @since 5.0.0
*/
class BeforeValidateDataEvent extends FormEvent
{
/**
* 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 = [])
{
parent::__construct($name, $arguments);
// For backward compatibility make sure the content is referenced
// TODO: Remove in Joomla 6
// @deprecated: Passing argument by reference is deprecated, and will not work in Joomla 6
if (key($arguments) === 0) {
$this->arguments['data'] = &$arguments[1];
} elseif (\array_key_exists('data', $arguments)) {
$this->arguments['data'] = &$arguments['data'];
}
}
/**
* Update the data.
*
* @param object|array $value The value to set
*
* @return static
*
* @since 5.0.0
*/
public function updateData(object|array $value): static
{
$this->arguments['data'] = $this->setData($value);
return $this;
}
}
No other release has this exact content. See every version of this file.