CoreFiles by mySites.guru
BeforeBatchEvent.php48 lines, 1,250 bytes, from Joomla_5.0.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 5.0.0-alpha1
md5
a67f8baf3bb218796394ac51c7bf049d
sha1
4751da5eb1428c496a6a93d703dfe81cd752af07
sha256
922419705778201d98dafee86f93346555bc253d65bdedf4551a293452c51f38
<?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 BadMethodCallException;
use Joomla\CMS\Event\AbstractImmutableEvent;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') 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 2 releases, Joomla 5.0.0-alpha1 to 5.0.0-alpha2. See them all, or every version of this file.