/var/www/html_it/wp-content/plugins/elementor/modules/atomic-widgets/styles/style-definition.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

namespace Elementor\Modules\AtomicWidgets\Styles;

class 
Style_Definition {
    private 
string $type 'class';
    private 
string $label '';

    
/** @var Style_Variant[] */
    
private array $variants = [];

    public static function 
make(): self {
        return new 
self();
    }

    public function 
set_typestring $type ): self {
        
$this->type $type;

        return 
$this;
    }

    public function 
set_labelstring $label ): self {
        
$this->label $label;

        return 
$this;
    }

    public function 
add_variantStyle_Variant $variant ): self {
        
$this->variants[] = $variant->build();

        return 
$this;
    }

    public function 
buildstring $id ): array {
        return [
            
'id' => $id,
            
'type' => $this->type,
            
'label' => $this->label,
            
'variants' => $this->variants,
        ];
    }
}