Init
This commit is contained in:
55
src/Expression.php
Normal file
55
src/Expression.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Kletellier\PdoWrapper;
|
||||
|
||||
class Expression
|
||||
{
|
||||
private $condition;
|
||||
private $operator;
|
||||
private $value;
|
||||
|
||||
public function __construct($condition, $operator, $value)
|
||||
{
|
||||
$this->condition = $condition;
|
||||
$this->operator = $operator;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function raw(): string
|
||||
{
|
||||
return "(" . $this->condition . " " . $this->operator . " ? )";
|
||||
}
|
||||
|
||||
public function getCondition()
|
||||
{
|
||||
return $this->condition;
|
||||
}
|
||||
|
||||
public function setCondition($condition)
|
||||
{
|
||||
$this->condition = $condition;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getOperator()
|
||||
{
|
||||
return $this->operator;
|
||||
}
|
||||
|
||||
public function setOperator($operator)
|
||||
{
|
||||
$this->operator = $operator;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
public function setValue($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user