database
11 months ago
import-export
1 year ago
import-export-customization
8 months ago
usage
7 months ago
utils
4 months ago
atomic-global-styles.php
5 months ago
global-classes-changes-resolver.php
11 months ago
global-classes-cleanup.php
4 months ago
global-classes-parser.php
5 months ago
global-classes-repository.php
4 months ago
global-classes-rest-api.php
7 months ago
global-classes.php
1 year ago
module.php
8 months ago
global-classes.php
35 lines
| 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 | |
| 11 | public static function make( array $items = [], array $order = [] ) { |
| 12 | return new static( $items, $order ); |
| 13 | } |
| 14 | |
| 15 | private function __construct( array $data = [], array $order = [] ) { |
| 16 | $this->items = Collection::make( $data ); |
| 17 | $this->order = Collection::make( $order ); |
| 18 | } |
| 19 | |
| 20 | public function get_items() { |
| 21 | return $this->items; |
| 22 | } |
| 23 | |
| 24 | public function get_order() { |
| 25 | return $this->order; |
| 26 | } |
| 27 | |
| 28 | public function get() { |
| 29 | return [ |
| 30 | 'items' => $this->get_items()->all(), |
| 31 | 'order' => $this->get_order()->all(), |
| 32 | ]; |
| 33 | } |
| 34 | } |
| 35 |