web-base/Core/Driver/SQL/Condition/CondBool.class.php

24 lines
457 B
PHP
Raw Permalink Normal View History

2020-04-02 00:02:51 +02:00
<?php
2022-11-18 18:06:46 +01:00
namespace Core\Driver\SQL\Condition;
2020-04-02 00:02:51 +02:00
use Core\Driver\SQL\SQL;
2020-04-02 00:02:51 +02:00
class CondBool extends Condition {
2020-04-03 17:39:58 +02:00
private $value;
2020-04-02 00:02:51 +02:00
public function __construct($val) {
$this->value = $val;
}
public function getValue() { return $this->value; }
function getExpression(SQL $sql, array &$params): string {
if (is_string($this->value)) {
return $sql->columnName($this->value);
} else {
return $sql->addValue($this->value);
}
}
2020-04-03 17:39:58 +02:00
}