getFilter($filters, $params); if ($sqlFilter != "") { $sql .= " where @@sqlFilter "; } return SqlHelper::createSafeSQL( $sql, [ "@@returnFields" => $returnFields, "@@tableName" => $tableName, "@@sqlFilter" => $sqlFilter ] ); } public function getRelation($name, $relation, $value, &$param) { $paramName = $name; $counter = 0; while (array_key_exists($paramName, $param)) { $paramName = $name . ($counter++); } $paramStr = function (&$param, $paramName, $value) { $param[$paramName] = trim($value); $result = "[[$paramName]]"; if (is_object($value)) { unset($param[$paramName]); $result = $value->__toString(); } return $result; }; $data = [ Relation::EQUAL => function (&$param, $name, $paramName, $value) use ($paramStr) { return " $name = " . $paramStr($param, $paramName, $value) . ' '; }, Relation::GREATER_THAN => function (&$param, $name, $paramName, $value) use ($paramStr) { return " $name > " . $paramStr($param, $paramName, $value) . ' '; }, Relation::LESS_THAN => function (&$param, $name, $paramName, $value) use ($paramStr) { return " $name < " . $paramStr($param, $paramName, $value) . ' '; }, Relation::GREATER_OR_EQUAL_THAN => function (&$param, $name, $paramName, $value) use ($paramStr) { return " $name >= " . $paramStr($param, $paramName, $value) . ' '; }, Relation::LESS_OR_EQUAL_THAN => function (&$param, $name, $paramName, $value) use ($paramStr) { return " $name <= " . $paramStr($param, $paramName, $value) . ' '; }, Relation::NOT_EQUAL => function (&$param, $name, $paramName, $value) use ($paramStr) { return " $name <> " . $paramStr($param, $paramName, $value) . ' '; }, Relation::STARTS_WITH => function (&$param, $name, $paramName, $value) use ($paramStr) { $value .= "%"; return " $name like " . $paramStr($param, $paramName, $value) . ' '; }, Relation::CONTAINS => function (&$param, $name, $paramName, $value) use ($paramStr) { $value = "%" . $value . "%"; return " $name like " . $paramStr($param, $paramName, $value) . ' '; } ]; return $data[$relation]($param, $name, $paramName, $value); } } __halt_compiler();----SIGNATURE:----MX5JxMT/wj7B4lbXpBNdNQW2JDiO16KU1zq/GSQ4XRYgXqyagIn/HaLW2Gi/RvtlzgjiCSn5E0mQi85IfO6s9REHV566KlvbHSFRTpvcaeu5FXs0bHEblK+ul9MSZxmEhY5bF4Lq3KPZtayY3hUs/98SxK4BtBengS2pP1UGmundxn7kn51cqHxwTjFdhLl2dfk7P6rMMpeqhifI98wmb5EKZZVUEey6cEAsd1aHqhzqnKRkb84nnaGb7tf+ZgAhggBP2bBg1pUm5CQFAjz6QTGIbKT1PiBrX/oS9QA5+Jixp8+4Y0W1x4RyZyrDNczcdm/a6+/T45u7H1rlaVaYUKcJeVD1x7JFirNP0HqDiQg3RAS0K+P0ZrZzM6sGokaJ8pt4cU2KI4siGxXkqaWC2AH2phDhc9bq32TB+2xxuGJ1bQyXddZv/Iz74YiGO8IlHNhew/eO32IQIvIag2w5u6G3Y+o76plluj2NBglYqV4/qpQ8hKacKglrEl/7oU7IYdw+aw46e7LuEiEDEbavr8+XXrfv8xlvM7h813I2GHXHpscYuIYoaxDNNFsWvRhlVqJrqft3QvLcc1VJpW0RieTdKmwBZTekXRqHelCtnEq80fkWQm5tmNTx+u8JR+ltgeGZadzblNiQfjyj4WjqkerUU5MY3C51KdPO73zh/sc=----ATTACHMENT:----NDM0ODg3MzM5NDE0NDEwOCAzODU1OTE1ODIzMDM2MzM3IDg4NjI5ODAyMjYzNDMyMzc=