PluginProbe
Elementor Website Builder – more than just a page builder / 3.34.2
Elementor Website Builder – more than just a page builder v3.34.2
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / modules / atomic-widgets / props-resolver / props-resolver-context.php

props-resolver-context.php in Elementor Website Builder – more than just a page builder 3.34.2, at modules/atomic-widgets/props-resolver/props-resolver-context.php

68 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\AtomicWidgets\PropsResolver;
4
5 use Elementor\Modules\AtomicWidgets\PropTypes\Contracts\Transformable_Prop_Type;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly.
9 }
10
11 class Props_Resolver_Context {
12 private ?string $key = null;
13
14 private ?Transformable_Prop_Type $prop_type;
15
16 private bool $disabled = false;
17
18 private ?Transformers_Registry $transformers_registry = null;
19
20 public static function make(): self {
21 return new static();
22 }
23
24 public function set_key( ?string $key ): self {
25 $this->key = $key;
26
27 return $this;
28 }
29
30 public function set_disabled( bool $disabled ): self {
31 $this->disabled = $disabled;
32
33 return $this;
34 }
35
36 public function set_prop_type( Transformable_Prop_Type $prop_type ): self {
37 $this->prop_type = $prop_type;
38
39 return $this;
40 }
41
42 public function get_key(): ?string {
43 return $this->key;
44 }
45
46 public function is_disabled(): bool {
47 return $this->disabled;
48 }
49
50 public function get_prop_type(): ?Transformable_Prop_Type {
51 return $this->prop_type;
52 }
53
54 public function set_transformers_registry( Transformers_Registry $transformers_registry ): self {
55 $this->transformers_registry = $transformers_registry;
56
57 return $this;
58 }
59
60 public function get_transformer( string $prop_type_key ): ?Transformer_Base {
61 if ( ! isset( $this->transformers_registry ) ) {
62 return null;
63 }
64
65 return $this->transformers_registry->get( $prop_type_key );
66 }
67 }
68