| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package FireBox |
| 4 |
* @version 3.1.10 Free |
| 5 |
* |
| 6 |
* @author FirePlugins <info@fireplugins.com> |
| 7 |
* @link https://www.fireplugins.com |
| 8 |
* @copyright Copyright © 2026 FirePlugins All Rights Reserved |
| 9 |
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later |
| 10 |
*/ |
| 11 |
|
| 12 |
namespace FireBox\Core\Analytics\Transformers; |
| 13 |
|
| 14 |
if (!defined('ABSPATH')) |
| 15 |
{ |
| 16 |
exit; // Exit if accessed directly. |
| 17 |
} |
| 18 |
|
| 19 |
class EventTransformer implements TransformerInterface |
| 20 |
{ |
| 21 |
public function shouldApply($type, $options = []) |
| 22 |
{ |
| 23 |
return $type === 'events'; |
| 24 |
} |
| 25 |
|
| 26 |
public function transform(&$data, $type, $options = []) |
| 27 |
{ |
| 28 |
foreach ($data as &$item) { |
| 29 |
$item->label = firebox()->_('FB_' . strtoupper($item->label) . '_EVENT'); |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
public function getPriority() |
| 34 |
{ |
| 35 |
return 50; |
| 36 |
} |
| 37 |
} |
| 38 |
|