| 1 |
<?php |
| 2 |
|
| 3 |
namespace AcyMailing\Types; |
| 4 |
|
| 5 |
use AcyMailing\Core\AcymObject; |
| 6 |
|
| 7 |
class OperatorType extends AcymObject |
| 8 |
{ |
| 9 |
public array $values = []; |
| 10 |
public array $attributes = []; |
| 11 |
|
| 12 |
public function __construct() |
| 13 |
{ |
| 14 |
parent::__construct(); |
| 15 |
|
| 16 |
$this->values[] = acym_selectOption('=', '='); |
| 17 |
$this->values[] = acym_selectOption('!=', '!='); |
| 18 |
$this->values[] = acym_selectOption('>', '>'); |
| 19 |
$this->values[] = acym_selectOption('<', '<'); |
| 20 |
$this->values[] = acym_selectOption('>=', '>='); |
| 21 |
$this->values[] = acym_selectOption('<=', '<='); |
| 22 |
$this->values[] = acym_selectOption('BEGINS', 'ACYM_BEGINS_WITH'); |
| 23 |
$this->values[] = acym_selectOption('END', 'ACYM_ENDS_WITH'); |
| 24 |
$this->values[] = acym_selectOption('CONTAINS', 'ACYM_CONTAINS'); |
| 25 |
$this->values[] = acym_selectOption('NOTCONTAINS', 'ACYM_NOT_CONTAINS'); |
| 26 |
$this->values[] = acym_selectOption('LIKE', 'LIKE'); |
| 27 |
$this->values[] = acym_selectOption('NOT LIKE', 'NOT LIKE'); |
| 28 |
$this->values[] = acym_selectOption('REGEXP', 'REGEXP'); |
| 29 |
$this->values[] = acym_selectOption('NOT REGEXP', 'NOT REGEXP'); |
| 30 |
$this->values[] = acym_selectOption('IS NULL', 'IS NULL'); |
| 31 |
$this->values[] = acym_selectOption('IS NOT NULL', 'IS NOT NULL'); |
| 32 |
} |
| 33 |
|
| 34 |
public function display( |
| 35 |
string $name, |
| 36 |
string $valueSelected = '', |
| 37 |
string $class = 'acym__select', |
| 38 |
bool $display = false |
| 39 |
): string { |
| 40 |
if (empty($this->attributes['class'])) { |
| 41 |
$this->attributes['class'] = $class; |
| 42 |
} |
| 43 |
|
| 44 |
return acym_select( |
| 45 |
$this->values, |
| 46 |
$name, |
| 47 |
$valueSelected, |
| 48 |
$this->attributes, |
| 49 |
'value', |
| 50 |
'text', |
| 51 |
null, |
| 52 |
false, |
| 53 |
$display |
| 54 |
); |
| 55 |
} |
| 56 |
} |
| 57 |
|