Merge pull request #23042 from eileenmcnaughton/sane
[civicrm-core.git] / Civi / Core / Event / PreEvent.php
CommitLineData
fd901044
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
41498ac5 4 | Copyright CiviCRM LLC. All rights reserved. |
fd901044 5 | |
41498ac5
TO
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 |
fd901044 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
fd901044
TO
11
12namespace Civi\Core\Event;
13
14/**
15 * Class AuthorizeEvent
16 * @package Civi\API\Event
17 */
c73e3098
TO
18class PreEvent extends GenericHookEvent {
19
fd901044 20 /**
8d0a3eb6
TO
21 * One of: 'create'|'edit'|'delete'
22 *
23 * @var string
fd901044
TO
24 */
25 public $action;
26
27 /**
28 * @var string
29 */
30 public $entity;
31
32 /**
e97c66ff 33 * @var int|null
fd901044
TO
34 */
35 public $id;
36
37 /**
38 * @var array
39 */
40 public $params;
41
7fe37828 42 /**
e97c66ff 43 * Class constructor.
44 *
45 * @param string $action
46 * @param string $entity
1178ca02 47 * @param int|null $id
e97c66ff 48 * @param array $params
7fe37828 49 */
c73e3098 50 public function __construct($action, $entity, $id, &$params) {
fd901044
TO
51 $this->action = $action;
52 $this->entity = $entity;
53 $this->id = $id;
c73e3098
TO
54 $this->params = &$params;
55 }
56
57 /**
58 * @inheritDoc
59 */
60 public function getHookValues() {
c64f69d9 61 return [$this->action, $this->entity, $this->id, &$this->params];
fd901044 62 }
96025800 63
fd901044 64}