<?php

/*
 * PuzzleApp
 * Webemyos
 * Jérôme Oliva
 * GNU Licence
 */

namespace Apps\Calendar\Helper;

use Apps\EeApp\Entity\EeAppAdmin;
use Core\Core\DataBase;


/**
 * Helper for Send Email
 * Run Workflow on Booking Event
 * @author jerome
 */
class WorkFlowHelper 
{
    public static function Run($core, $trigger, $data) {

        $app = \Apps\EeApp\Helper\AppHelper::HaveApp($core, "Workflow");

        if($app != false){

            $appPath = "\Apps\\" .$app->Name->Value . "\\". $app->Name->Value;  
            $workflow = new $appPath($core);
            return $workflow->Start($trigger, $data);
        }
    }
}