PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.3
Elementor Website Builder – more than just a page builder v4.2.3
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 4.0.7 All 451 releases
elementor / modules / atomic-widgets / elements / base / element-builder.php

element-builder.php in Elementor Website Builder – more than just a page builder 4.2.3, at modules/atomic-widgets/elements/base/element-builder.php

62 lines 1.3 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\Elements\Base;
4
5 class Element_Builder {
6 protected $element_type;
7 protected $settings = [];
8 protected $is_locked = false;
9 protected $children = [];
10 protected $editor_settings = [];
11 protected $meta = [];
12
13 public static function make( string $element_type ) {
14 return new self( $element_type );
15 }
16
17 private function __construct( string $element_type ) {
18 $this->element_type = $element_type;
19 }
20
21 public function settings( array $settings ) {
22 $this->settings = $settings;
23 return $this;
24 }
25
26 public function is_locked( $is_locked ) {
27 $this->is_locked = $is_locked;
28 return $this;
29 }
30
31 public function editor_settings( array $editor_settings ) {
32 $this->editor_settings = $editor_settings;
33 return $this;
34 }
35
36 public function children( array $children ) {
37 $this->children = $children;
38 return $this;
39 }
40
41 public function meta( array $meta ) {
42 $this->meta = $meta;
43 return $this;
44 }
45
46 public function build() {
47 $element_data = [
48 'elType' => $this->element_type,
49 'settings' => $this->settings,
50 'isLocked' => $this->is_locked,
51 'editor_settings' => $this->editor_settings,
52 'elements' => $this->children,
53 ];
54
55 if ( ! empty( $this->meta ) ) {
56 $element_data['meta'] = $this->meta;
57 }
58
59 return $element_data;
60 }
61 }
62