PluginProbe
Depicter — Popup & Slider Builder / 1.6.2
Depicter — Popup & Slider Builder v1.6.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / DataSources / DataSourceBase.php

DataSourceBase.php in Depicter — Popup & Slider Builder 1.6.2, at app/src/DataSources/DataSourceBase.php

80 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\DataSources;
3
4 use Averta\Core\Utility\Arr;
5
6 class DataSourceBase
7 {
8 /**
9 * DataSource name
10 *
11 * @var string
12 */
13 protected $type = 'base';
14
15 /**
16 * DataSource properties
17 *
18 * @var array
19 */
20 protected $properties = [];
21
22 /**
23 * Default input params for retrieving dataSource records
24 *
25 * @var array
26 */
27 protected $defaultInputParams = [];
28
29 /**
30 * Asset groups of this DataSource
31 *
32 * @var array
33 */
34 protected $assetGroupNames = [];
35
36
37 /**
38 * Prepares arguments for retrieving dataSource records
39 *
40 * @param array|object $args
41 *
42 * @return array
43 */
44 protected function prepare( $args ){
45 $defaultParams = Arr::merge( $this->defaultInputParams, $this->getProperties() );
46 return Arr::merge( $args, $defaultParams );
47 }
48
49 /**
50 * Get a property value
51 *
52 * @param string $name
53 *
54 * @return string|null
55 */
56 public function getProperty( string $name ){
57 return $this->properties[ $name ] ?? null;
58 }
59
60 /**
61 * Get all dataSource properties
62 *
63 * @return array|string[]
64 */
65 public function getProperties(){
66 return $this->properties;
67 }
68
69 /**
70 * Get asset groups of this DataSource
71 *
72 * @return array
73 */
74 public function getAssetGroupNames(){
75 return $this->assetGroupNames;
76 }
77
78
79 }
80