for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helix\DB\SQL;
use Helix\DB\Select;
/**
* Represents a logical expression. Produces more predicates.
*/
class Predicate extends Expression implements ValueInterface {
use PredicateTrait;
* `(... AND ...)`
*
* @param string[] $conditions
* @return Predicate
public static function all (array $conditions) {
if (count($conditions) === 1) {
return reset($conditions);
}
return new static('(' . implode(' AND ', $conditions) . ')');
* `(... OR ...)`
public static function any (array $conditions) {
return new static('(' . implode(' OR ', $conditions) . ')');
* `NOT($this)`
public function invert () {
return new static("NOT({$this})");