3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
12 namespace Civi\Core\Event
;
15 * Class AuthorizeEvent
16 * @package Civi\API\Event
18 class PostEvent
extends GenericHookEvent
{
21 * This adapter automatically emits a narrower event.
23 * For example, `hook_civicrm_pre(Contact, ...)` will also dispatch `hook_civicrm_pre::Contact`.
25 * @param \Civi\Core\Event\PostEvent $event
27 public static function dispatchSubevent(PostEvent
$event) {
28 \Civi
::service('dispatcher')->dispatch("hook_civicrm_post::" . $event->entity
, $event);
32 * @var string 'create'|'edit'|'delete' etc
54 * @param string $action
55 * @param string $entity
57 * @param object $object
59 public function __construct($action, $entity, $id, &$object) {
60 $this->action
= $action;
61 $this->entity
= $entity;
63 $this->object = &$object;
69 public function getHookValues() {
70 return [$this->action
, $this->entity
, $this->id
, &$this->object];