- md5
- e5eb6197f6316b7c7bf1d1e173693b8f
- sha1
- 2b1fd92778a5010ae629dbac941406221f5df99e
- sha256
- a4faf5de2e7c42ec19846cb5b72a11af5af258ef087f26114a7632c7cbe246df
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
<?php
/**
* Joomla! Content Management System
*
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Event\Table;
// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Event class for JTable's onBeforeLoad event
*
* @since 4.0.0
*/
class BeforeLoadEvent extends AbstractEvent
{
/**
* Constructor.
*
* Mandatory arguments:
* subject JTableInterface The table we are operating on
* keys mixed The optional primary key value to load the row by, or an array of fields to match.
* reset boolean True to reset the default values before loading the new row.
*
* @param string $name The event name.
* @param array $arguments The event arguments.
*
* @throws \BadMethodCallException
*/
public function __construct($name, array $arguments = [])
{
if (!\array_key_exists('keys', $arguments)) {
throw new \BadMethodCallException("Argument 'keys' is required for event $name");
}
if (!\array_key_exists('reset', $arguments)) {
throw new \BadMethodCallException("Argument 'reset' is required for event $name");
}
parent::__construct($name, $arguments);
}
/**
* Setter for the reset attribute
*
* @param mixed $value The value to set
*
* @return boolean Normalised value
*/
protected function setReset($value)
{
return $value ? true : false;
}
}
The same content is in 4 releases, Joomla 4.4.0-alpha3 to 4.4.0-beta2. See them all, or every version of this file.