CoreFiles by mySites.guru
AfterStoreEvent.php57 lines, 1,492 bytes, from Joomla_5.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 5.0.0-beta1
md5
b226ce3434c705e64095c1a76e6dee3e
sha1
cd463868f1a3b1fb7209492244ea5bb2426977d5
sha256
352392f12e6596bb38b209a904a77d8834fdc96cda12b7280a111a440b6ad43c
<?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('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Event class for \Joomla\CMS\Table\Table onAfterStore event
 *
 * @since  4.0.0
 */
class AfterStoreEvent extends AbstractEvent
{
    /**
     * Constructor.
     *
     * Mandatory arguments:
     * subject      \Joomla\CMS\Table\TableInterface 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 = [])
    {
        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 4 releases, Joomla 5.0.0-alpha3 to 5.0.0-beta2. See them all, or every version of this file.