| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\Announcements\Classes; |
| 4 |
|
| 5 |
use Elementor\Modules\Announcements\Triggers\{ |
| 6 |
IsFlexContainerInactive, AiStarted |
| 7 |
}; |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
|
| 13 |
class Utils { |
| 14 |
/** |
| 15 |
* get_trigger_object |
| 16 |
* |
| 17 |
* @param $trigger |
| 18 |
* |
| 19 |
* @return IsFlexContainerInactive|false |
| 20 |
*/ |
| 21 |
public static function get_trigger_object( $trigger ) { |
| 22 |
//@TODO - replace with trigger manager |
| 23 |
switch ( $trigger['action'] ) { |
| 24 |
case 'isFlexContainerInactive': |
| 25 |
return new IsFlexContainerInactive(); |
| 26 |
case 'aiStared': |
| 27 |
return new AiStarted(); |
| 28 |
default: |
| 29 |
return false; |
| 30 |
} |
| 31 |
} |
| 32 |
} |
| 33 |
|