- md5
- 3375a4a0c35407124af182a058fc3c9f
- sha1
- f144244f24fad2304363d5c507779a4412627bf5
- sha256
- 03e7f8c2f9cca4b253b6b71f2317bf3a79a1c473cd76a305e191522a407adbf2
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
<?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
*/
namespace Joomla\CMS\Event\Table;
use BadMethodCallException;
// 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 = array())
{
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 11 releases, Joomla 4.2.1 to 4.3.0-alpha2. See them all, or every version of this file.