[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/application/src/Event/ -> ApplicationErrorEvent.php (source)

   1  <?php
   2  /**
   3   * Part of the Joomla Framework Application Package
   4   *
   5   * @copyright  Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE
   7   */
   8  
   9  namespace Joomla\Application\Event;
  10  
  11  use Joomla\Application\AbstractApplication;
  12  use Joomla\Application\ApplicationEvents;
  13  use Joomla\Event\Event;
  14  
  15  /**
  16   * Event class thrown when an application error occurs.
  17   *
  18   * @since  2.0.0
  19   */
  20  class ApplicationErrorEvent extends ApplicationEvent
  21  {
  22      /**
  23       * The Throwable object with the error data.
  24       *
  25       * @var    \Throwable
  26       * @since  2.0.0
  27       */
  28      private $error;
  29  
  30      /**
  31       * Event constructor.
  32       *
  33       * @param   \Throwable           $error        The Throwable object with the error data.
  34       * @param   AbstractApplication  $application  The active application.
  35       *
  36       * @since   2.0.0
  37       */
  38  	public function __construct(\Throwable $error, AbstractApplication $application)
  39      {
  40          parent::__construct(ApplicationEvents::ERROR, $application);
  41  
  42          $this->error = $error;
  43      }
  44  
  45      /**
  46       * Get the error object.
  47       *
  48       * @return  \Throwable
  49       *
  50       * @since   2.0.0
  51       */
  52  	public function getError(): \Throwable
  53      {
  54          return $this->error;
  55      }
  56  
  57      /**
  58       * Set the error object.
  59       *
  60       * @param   \Throwable  $error  The error object to set to the event.
  61       *
  62       * @return  void
  63       *
  64       * @since   2.0.0
  65       */
  66  	public function setError(\Throwable $error): void
  67      {
  68          $this->error = $error;
  69      }
  70  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer