CoreFiles by mySites.guru
BeforeBatchEvent.php47 lines, 1,233 bytes, from Joomla_4.4.13-Stable-Full_Package.zip
Raw History Compare with 4.4.12
md5
67d29b7bb722b2f1d78ca506be7892e5
sha1
9c4a9c3e9e2330d0b2c7065cfe7af55435b093fc
sha256
ce303ff0d52ebef06c35c56c2d4a88af41f2fc57ebbd28406c3663a369385fa7
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2020 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;

use Joomla\CMS\Event\AbstractImmutableEvent;

// phpcs:disable PSR1.Files.SideEffects
\defined('JPATH_PLATFORM') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Event class for modifying a table object before a batch event is applied
 *
 * @since  4.0.0
 */
class BeforeBatchEvent extends AbstractImmutableEvent
{
    /**
     * Constructor.
     *
     * @param   string  $name       The event name.
     * @param   array   $arguments  The event arguments.
     *
     * @throws  \BadMethodCallException
     *
     * @since   4.0.0
     */
    public function __construct($name, array $arguments = [])
    {
        if (!\array_key_exists('src', $arguments)) {
            throw new \BadMethodCallException("Argument 'src' is required for event $name");
        }

        if (!\array_key_exists('type', $arguments)) {
            throw new \BadMethodCallException("Argument 'type' is required for event $name");
        }

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

The same content is in 35 releases, Joomla 4.4.0-alpha3 to 4.4.14. See them all, or every version of this file.