| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\Modules\AtomicWidgets\Elements; |
| 4 |
|
| 5 |
class Element_Builder { |
| 6 |
protected $element_type; |
| 7 |
protected $settings; |
| 8 |
protected $is_locked; |
| 9 |
|
| 10 |
public static function make( $element_type ) { |
| 11 |
return new self( $element_type ); |
| 12 |
} |
| 13 |
|
| 14 |
private function __construct( $element_type ) { |
| 15 |
$this->element_type = $element_type; |
| 16 |
} |
| 17 |
|
| 18 |
public function settings( array $settings ) { |
| 19 |
$this->settings = $settings; |
| 20 |
return $this; |
| 21 |
} |
| 22 |
|
| 23 |
public function is_locked( $is_locked ) { |
| 24 |
$this->is_locked = $is_locked; |
| 25 |
return $this; |
| 26 |
} |
| 27 |
|
| 28 |
public function build() { |
| 29 |
return [ |
| 30 |
'elType' => $this->element_type, |
| 31 |
'settings' => $this->settings, |
| 32 |
'isLocked' => $this->is_locked, |
| 33 |
]; |
| 34 |
} |
| 35 |
} |
| 36 |
|