mirror of
https://github.com/koel/koel
synced 2024-11-28 06:50:27 +00:00
28 lines
715 B
PHP
28 lines
715 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
enum SmartPlaylistOperator: string
|
|
{
|
|
case IS = 'is';
|
|
case IS_NOT = 'isNot';
|
|
case CONTAINS = 'contains';
|
|
case NOT_CONTAIN = 'notContain';
|
|
case IS_BETWEEN = 'isBetween';
|
|
case IS_GREATER_THAN = 'isGreaterThan';
|
|
case IS_LESS_THAN = 'isLessThan';
|
|
case BEGINS_WITH = 'beginsWith';
|
|
case ENDS_WITH = 'endsWith';
|
|
case IN_LAST = 'inLast';
|
|
case NOT_IN_LAST = 'notInLast';
|
|
case IS_NOT_BETWEEN = 'isNotBetween';
|
|
|
|
public function toEloquentClause(): string
|
|
{
|
|
return match ($this) {
|
|
self::IS_BETWEEN => 'whereBetween',
|
|
self::IS_NOT_BETWEEN => 'whereNotBetween',
|
|
default => 'where',
|
|
};
|
|
}
|
|
}
|