35 lines
644 B
PHP
35 lines
644 B
PHP
<?php
|
|
/**
|
|
* @author Daniel J. Summers <daniel@bitbadger.solutions>
|
|
* @license MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace BitBadger\PDODocument;
|
|
|
|
/**
|
|
* How multiple fields should be matched
|
|
*/
|
|
enum FieldMatch
|
|
{
|
|
/** Match all provided fields (`AND`) */
|
|
case All;
|
|
|
|
/** Match any provided fields (`OR`) */
|
|
case Any;
|
|
|
|
/**
|
|
* Get the SQL keyword for this enumeration value
|
|
*
|
|
* @return string The SQL keyword for this enumeration value
|
|
*/
|
|
public function toSQL(): string
|
|
{
|
|
return match ($this) {
|
|
FieldMatch::All => 'AND',
|
|
FieldMatch::Any => 'OR',
|
|
};
|
|
}
|
|
}
|