← All changes
|
modules/atomic-widgets/prop-dependencies/manager.php
+2
-22
4.0.9
→
3.33.0-beta1
View file →
| @@ -35,10 +35,9 @@ | ||
| 35 | 35 | * terms: array{ |
| 36 | 36 | * operator: string, |
| 37 | 37 | * path: array<string>, |
| 38 | 38 | * value?: mixed, |
| 39 | - * newValue?: array, | |
| 40 | - * effect?: 'hide'|'disable' | |
| 39 | + * newValue?: array | |
| 41 | 40 | * } |
| 42 | 41 | * } |
| 43 | 42 | */ |
| 44 | 43 | private ?array $dependencies; |
| @@ -72,29 +71,12 @@ | ||
| 72 | 71 | * operator: string, |
| 73 | 72 | * path: array<string>, |
| 74 | 73 | * value?: mixed, |
| 75 | 74 | * newValue?: array, |
| 76 | - * effect?: 'hide'|'disable' | |
| 77 | 75 | * } |
| 78 | 76 | * @return self |
| 79 | 77 | */ |
| 80 | - public function where( array $config, $new_value = null ): self { | |
| 81 | - if ( isset( $config['terms'] ) ) { | |
| 82 | - if ( empty( $this->dependencies ) ) { | |
| 83 | - $this->new(); | |
| 84 | - } | |
| 85 | - | |
| 86 | - $term = [ | |
| 87 | - 'terms' => $config['terms'], | |
| 88 | - 'relation' => $config['relation'] ?? self::RELATION_OR, | |
| 89 | - 'newValue' => $new_value ?? null, | |
| 90 | - 'effect' => $config['effect'] ?? 'disable', | |
| 91 | - ]; | |
| 92 | - $this->dependencies['terms'][] = $term; | |
| 93 | - | |
| 94 | - return $this; | |
| 95 | - } | |
| 96 | - | |
| 78 | + public function where( array $config ): self { | |
| 97 | 79 | if ( ! isset( $config['operator'] ) || ! isset( $config['path'] ) ) { |
| 98 | 80 | Utils::safe_throw( 'Term missing mandatory configurations' ); |
| 99 | 81 | } |
| 100 | 82 | |
| @@ -104,12 +86,10 @@ | ||
| 104 | 86 | |
| 105 | 87 | $term = [ |
| 106 | 88 | 'operator' => $config['operator'], |
| 107 | 89 | 'path' => $config['path'], |
| 108 | - 'nestedPath' => $config['nestedPath'] ?? null, | |
| 109 | 90 | 'value' => $config['value'] ?? null, |
| 110 | 91 | 'newValue' => $config['newValue'] ?? null, |
| 111 | - 'effect' => $config['effect'] ?? 'disable', | |
| 112 | 92 | ]; |
| 113 | 93 | |
| 114 | 94 | if ( empty( $this->dependencies ) ) { |
| 115 | 95 | $this->new(); |