PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / trunk
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress vtrunk
11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 10.3.0 10.4.0 All 60 releases
acymailing / back / Types / OperatorType.php

OperatorType.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress trunk, at back/Types/OperatorType.php

57 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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