Commit | Line | Data |
---|---|---|
bf58f0cb MW |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | Copyright CiviCRM LLC. All rights reserved. | | |
5 | | | | |
6 | | This work is published under the GNU AGPLv3 license with some | | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
9 | +--------------------------------------------------------------------+ | |
10 | */ | |
11 | ||
12 | namespace Civi\Core\Event; | |
13 | ||
14 | /** | |
15 | * This triggers when a smarty parse error happens via \Smarty::trigger_error | |
16 | * Event: civi.smarty.error | |
17 | * | |
18 | * Class SmartyErrorEvent | |
19 | * @package Civi\API\Event | |
20 | */ | |
21 | class SmartyErrorEvent extends \Symfony\Component\EventDispatcher\Event { | |
22 | ||
23 | /** | |
24 | * The error message generated by smarty | |
25 | * @var string | |
26 | */ | |
27 | public $errorMsg; | |
28 | ||
29 | /** | |
30 | * The error type - one of PHP error constants | |
31 | * @var int | |
32 | */ | |
33 | public $errorType; | |
34 | ||
35 | /** | |
36 | * @param string $errorMsg | |
37 | * @param int $errorType | |
38 | */ | |
39 | public function __construct($errorMsg, $errorType) { | |
40 | $this->errorMsg = $errorMsg; | |
41 | $this->errorType = $errorType; | |
42 | } | |
43 | ||
44 | /** | |
45 | * @inheritDoc | |
46 | */ | |
47 | public function getHookValues() { | |
48 | return [$this->errorMsg, $this->errorType]; | |
49 | } | |
50 | ||
51 | } |