HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: /var/www/html/appointmentbook.me/wp-content/plugins/mailpoet/lib/Automation/Engine/Hooks.php
<?php declare(strict_types = 1);

namespace MailPoet\Automation\Engine;

if (!defined('ABSPATH')) exit;


use MailPoet\Automation\Engine\Data\Automation;
use MailPoet\Automation\Engine\Data\AutomationRunLog;
use MailPoet\Automation\Engine\Data\Step;

class Hooks {
  /** @var WordPress */
  private $wordPress;

  public function __construct(
    WordPress $wordPress
  ) {
    $this->wordPress = $wordPress;
  }

  public const INITIALIZE = 'mailpoet/automation/initialize';
  public const API_INITIALIZE = 'mailpoet/automation/api/initialize';
  public const TRIGGER = 'mailpoet/automation/trigger';
  public const AUTOMATION_STEP = 'mailpoet/automation/step';

  public const EDITOR_BEFORE_LOAD = 'mailpoet/automation/editor/before_load';

  public const AUTOMATION_BEFORE_SAVE = 'mailpoet/automation/before_save';
  public const AUTOMATION_STEP_BEFORE_SAVE = 'mailpoet/automation/step/before_save';

  public const AUTOMATION_STEP_LOG_AFTER_RUN = 'mailpoet/automation/step/log_after_run';

  public const AUTOMATION_RUN_CREATE = 'mailpoet/automation/run/create';

  public function doAutomationBeforeSave(Automation $automation): void {
    $this->wordPress->doAction(self::AUTOMATION_BEFORE_SAVE, $automation);
  }

  public function doAutomationStepBeforeSave(Step $step, Automation $automation): void {
    $this->wordPress->doAction(self::AUTOMATION_STEP_BEFORE_SAVE, $step, $automation);
  }

  public function doAutomationStepByKeyBeforeSave(Step $step, Automation $automation): void {
    $this->wordPress->doAction(self::AUTOMATION_STEP_BEFORE_SAVE . '/key=' . $step->getKey(), $step, $automation);
  }

  public function doAutomationStepAfterRun(AutomationRunLog $automationRunLog): void {
    $this->wordPress->doAction(self::AUTOMATION_STEP_LOG_AFTER_RUN, $automationRunLog);
  }
}