Routing test 1

This commit is contained in:
2020-06-19 14:12:07 +02:00
parent 077fe68914
commit 78c5934480
10 changed files with 136 additions and 23 deletions

View File

@@ -6,6 +6,7 @@ use Driver\SQL\Column\Column;
use Driver\SQL\Condition\Compare;
use Driver\SQL\Condition\CondBool;
use Driver\SQL\Condition\CondOr;
use Driver\SQL\Condition\Regex;
use Driver\SQL\Constraint\Constraint;
use \Driver\SQL\Constraint\Unique;
use \Driver\SQL\Constraint\PrimaryKey;
@@ -326,11 +327,17 @@ abstract class SQL {
return $this->buildCondition($condition[0], $params);
} else {
$conditions = array();
foreach($condition as $cond) {
foreach ($condition as $cond) {
$conditions[] = $this->buildCondition($cond, $params);
}
return implode(" AND ", $conditions);
}
} else if ($condition instanceof Regex) {
$left = $condition->getLeftExp();
$right = $condition->getRightExp();
$left = ($left instanceof Column) ? $this->columnName($left->getName()) : $this->addValue($left, $params);
$right = ($right instanceof Column) ? $this->columnName($right->getName()) : $this->addValue($right, $params);
return $left . " REGEXP " . $right;
} else {
$this->lastError = "Unsupported condition type: " . get_class($condition);
return false;