PluginProbe ʕ •ᴥ•ʔ
ECS – Ele Custom Skin for Elementor / 4.3.6
ECS – Ele Custom Skin for Elementor v4.3.6
4.3.6 4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.11 4.1.10 4.1.9 4.1.8 4.1.6 4.1.7 4.1.5 4.1.4 4.1.1 4.1.2 trunk 1.0.0 1.0.1 1.0.9 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.4 1.2.5 1.3.10 1.3.11 1.3.3 1.3.4 1.3.6 1.3.7 1.3.9 1.4.0 2.0.2 2.1.0 2.2.0 2.2.1 2.2.2 3.0.0 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 4.1.0
ele-custom-skin / modules / dynamic-repeater / class-ecs-drb-sources.php
ele-custom-skin / modules / dynamic-repeater Last commit date
assets 2 weeks ago sources 2 months ago class-ecs-drb-mapper.php 2 months ago class-ecs-drb-sources.php 2 months ago class-ecs-dynamic-repeater-module.php 2 weeks ago
class-ecs-drb-sources.php
47 lines
1 <?php
2 /**
3 * Dynamic Repeater Builder — Source Registry
4 */
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit;
8 }
9
10 class ECS_DRB_Sources {
11
12 private static ?self $instance = null;
13
14 /** @var ECS_DRB_Source_Base[] */
15 private array $sources = [];
16
17 public static function instance(): self {
18 if ( null === self::$instance ) {
19 self::$instance = new self();
20 }
21 return self::$instance;
22 }
23
24 private function __construct() {}
25
26 public function register( ECS_DRB_Source_Base $source ): void {
27 $this->sources[ $source->get_id() ] = $source;
28 }
29
30 public function get( string $id ): ?ECS_DRB_Source_Base {
31 return $this->sources[ $id ] ?? null;
32 }
33
34 /** @return ECS_DRB_Source_Base[] */
35 public function get_all(): array {
36 return $this->sources;
37 }
38
39 /** Compact list for wp_localize_script. */
40 public function get_list_for_js(): array {
41 return array_values( array_map( fn( $s ) => [
42 'id' => $s->get_id(),
43 'label' => $s->get_label(),
44 ], $this->sources ) );
45 }
46 }
47