/*
* Your installation or use of this Upsert file is subject to the applicable terms available at:
* https://upsertconsulting.com/documents/eula-for-upsert-software/
* If you do not agree to all of the applicable terms or do not have the authority to bind the entity as an authorized representative,
* then do not install or use this file.
*
* Modifications to this file without prior written consent from Upsert are prohibited.
*
* Copyright (C) Upsert, LLC. All rights reserved.
*/
namespace Sugarcrm\Sugarcrm\custom\Upsert\Deduplicate\Libraries\Sugar\Classes\Helpers;
use Doctrine\DBAL\Connection;
use PDO;
use Sugarcrm\Sugarcrm\custom\Upsert\Deduplicate\Libraries\PHP\Classes\Helpers\Str;
use Sugarcrm\Sugarcrm\custom\Upsert\Deduplicate\Libraries\Sugar\Classes\Helpers\Bean;
use Sugarcrm\Sugarcrm\custom\Upsert\Deduplicate\Libraries\Sugar\Classes\Helpers\Vardef;
use Sugarcrm\Sugarcrm\Dbal\Query\QueryBuilder;
use SugarQuery;
class Query
{
public const CRUD_CREATE = "CREATE";
public const CRUD_READ = "READ";
public const CRUD_UPDATE = "UPDATE";
public const CRUD_DELETE = "DELETE";
public const CRUD_UNKNOWN = "UNKNOWN";
public static function compile($u1b1cc7f086b3f074da452bc3129981eb)
{
if (!$u1b1cc7f086b3f074da452bc3129981eb || !is_object($u1b1cc7f086b3f074da452bc3129981eb)) {
return false;
}
$uac5c74b64b4b8352ef2f181affb5ac2a = null;
$u166e64f6c3677d0c513901242a3e702d = null;
$ud14a8022b085f9ef19d479cbdd581127 = null;
try {
if ($u1b1cc7f086b3f074da452bc3129981eb instanceof SugarQuery) {
$u217ecb18a8f8e5f1889339c3fa093fc3 = $u1b1cc7f086b3f074da452bc3129981eb->compile();
$uac5c74b64b4b8352ef2f181affb5ac2a = $u217ecb18a8f8e5f1889339c3fa093fc3->getSQL();
$u166e64f6c3677d0c513901242a3e702d = $u217ecb18a8f8e5f1889339c3fa093fc3->getParameters();
$ud14a8022b085f9ef19d479cbdd581127 = $u217ecb18a8f8e5f1889339c3fa093fc3->getParameterTypes();
return static::combine($uac5c74b64b4b8352ef2f181affb5ac2a, $u166e64f6c3677d0c513901242a3e702d, $ud14a8022b085f9ef19d479cbdd581127);
} elseif ($u1b1cc7f086b3f074da452bc3129981eb instanceof QueryBuilder) {
$uac5c74b64b4b8352ef2f181affb5ac2a = $u1b1cc7f086b3f074da452bc3129981eb->getSQL();
$u166e64f6c3677d0c513901242a3e702d = $u1b1cc7f086b3f074da452bc3129981eb->getParameters();
$ud14a8022b085f9ef19d479cbdd581127 = $u1b1cc7f086b3f074da452bc3129981eb->getParameterTypes();
return static::combine($uac5c74b64b4b8352ef2f181affb5ac2a, $u166e64f6c3677d0c513901242a3e702d, $ud14a8022b085f9ef19d479cbdd581127);
}
} catch (\Throwable $ue1671797c52e15f763380b45e841ec32) {
$ue5978d950a3223d62bc60d5dd7f0b714 = $uac5c74b64b4b8352ef2f181affb5ac2a !== null ? substr_count(preg_replace("/'.*?'(*SKIP)(*FAIL)|".*?"(*SKIP)(*FAIL)|\?/", "