CoreFiles by mySites.guru
AfterStoreEvent.php58 lines, 1,291 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
f67d3c4375e059112f037b2dd209aac1
sha1
e7bc2232843f1c855fb030b77230d11865945bc2
sha256
2ae22b3cc3db83ec5abacb87635447d73b77dd6221daed8e4f3a87a9f00be909
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE
 */

namespace Joomla\CMS\Event\Table;

\defined('JPATH_PLATFORM') or die;

use BadMethodCallException;

/**
 * Event class for JTable's onAfterStore event
 *
 * @since  4.0.0
 */
class AfterStoreEvent extends AbstractEvent
{
	/**
	 * Constructor.
	 *
	 * Mandatory arguments:
	 * subject		JTableInterface	The table we are operating on
	 * result		boolean         Did the save succeed?
	 *
	 * @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('result', $arguments))
		{
			throw new BadMethodCallException("Argument 'result' is required for event $name");
		}

		parent::__construct($name, $arguments);
	}

	/**
	 * Setter for the result argument
	 *
	 * @param   boolean  $value  The value to set
	 *
	 * @return  boolean
	 *
	 * @throws  BadMethodCallException  if the argument is not of the expected type
	 */
	protected function setResult($value)
	{
		return $value ? true : false;
	}

}

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.