PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.5
Elementor Website Builder – more than just a page builder v4.1.5
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 / global-classes / global-classes.php

global-classes.php in Elementor Website Builder – more than just a page builder 4.1.5, at modules/global-classes/global-classes.php

43 lines 931 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\GlobalClasses;
4
5 use Elementor\Core\Utils\Collection;
6
7 class Global_Classes {
8 private Collection $items;
9 private Collection $order;
10 private Collection $ordered_items;
11
12 public static function make( array $items = [], array $order = [] ) {
13 return new static( $items, $order );
14 }
15
16 private function __construct( array $data = [], array $order = [] ) {
17 $this->items = Collection::make( $data );
18 $this->order = Collection::make( $order );
19 $this->ordered_items = $this->order
20 ->map( fn( $id ) => $data[ $id ] ?? null )
21 ->filter( fn( $item ) => null !== $item );
22 }
23
24 public function get_items() {
25 return $this->items;
26 }
27
28 public function get_order() {
29 return $this->order;
30 }
31
32 public function get_ordered_items() {
33 return $this->ordered_items;
34 }
35
36 public function get() {
37 return [
38 'items' => $this->get_items()->all(),
39 'order' => $this->get_order()->all(),
40 ];
41 }
42 }
43