alpha2 (#2)
- Change multiple field matching to enum - Implement auto-generated IDs Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
28
src/FieldMatch.php
Normal file
28
src/FieldMatch.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php 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 toString(): string
|
||||
{
|
||||
return match ($this) {
|
||||
FieldMatch::All => 'AND',
|
||||
FieldMatch::Any => 'OR'
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user