| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package FireBox |
| 4 |
* @version 3.1.11 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\Metrics; |
| 13 |
|
| 14 |
use FireBox\Core\Analytics\QueryBuilders\ConversionsQueryStrategyFactory; |
| 15 |
|
| 16 |
if (!defined('ABSPATH')) |
| 17 |
{ |
| 18 |
exit; // Exit if accessed directly. |
| 19 |
} |
| 20 |
|
| 21 |
class Conversions extends Metric |
| 22 |
{ |
| 23 |
/** |
| 24 |
* Get data using strategy pattern |
| 25 |
*/ |
| 26 |
public function getData() |
| 27 |
{ |
| 28 |
$strategy = $this->createQueryStrategy(); |
| 29 |
|
| 30 |
$sql = "SELECT |
| 31 |
{$strategy->getSelect()} |
| 32 |
FROM |
| 33 |
{$strategy->getFromAndJoins()} |
| 34 |
WHERE |
| 35 |
1 |
| 36 |
{$strategy->getWherePeriod()} |
| 37 |
{$strategy->getWhere()} |
| 38 |
{$strategy->getFilters()} |
| 39 |
{$strategy->getGroupBy()} |
| 40 |
{$strategy->getOrderBy()} |
| 41 |
{$strategy->getLimitOffset()} |
| 42 |
"; |
| 43 |
|
| 44 |
return $this->executeQuery($sql); |
| 45 |
} |
| 46 |
|
| 47 |
/** |
| 48 |
* Create query strategy for this metric |
| 49 |
*/ |
| 50 |
protected function createQueryStrategy() |
| 51 |
{ |
| 52 |
return ConversionsQueryStrategyFactory::create($this->type, $this); |
| 53 |
} |
| 54 |
|
| 55 |
/** |
| 56 |
* Indicates this class handles timezone conversion in SQL |
| 57 |
*/ |
| 58 |
public function hasTimezoneSQLConversion() |
| 59 |
{ |
| 60 |
return true; |
| 61 |
} |
| 62 |
} |