PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.43
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.43
5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 5.5.42 All 160 releases
wp-data-access / WPDataProjects / Data_Dictionary / WPDP_List_Columns_Cache.php

WPDP_List_Columns_Cache.php in WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards 5.5.43, at WPDataProjects/Data_Dictionary/WPDP_List_Columns_Cache.php

52 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Suppress "error - 0 - No summary was found for this file" on phpdoc generation
5 *
6 * @package WPDataProjects\Data_Dictionary
7 */
8
9 namespace WPDataProjects\Data_Dictionary {
10
11 /**
12 * Class WPDP_List_Columns_Cache
13 *
14 * Instances of object WPDP_List_Columns are cached in this class
15 *
16 * @author Peter Schulz
17 * @since 2.0.0
18 */
19 class WPDP_List_Columns_Cache {
20
21 /**
22 * List of cached instances of WPDP_List_Columns
23 *
24 * @var array
25 */
26 protected static $cached_list_columns = array();
27
28 /**
29 * Gets an instance of WPDP_List_Columns from cache or creates a new instance
30 *
31 * New instances are added to the cache
32 *
33 * @param string $schema_name Database schema name
34 * @param string $table_name Database table name
35 * @param string $label_type Label type
36 * @param string $setname Options set name
37 *
38 * @return object Handle to WPDP_List_Columns instance
39 */
40 public static function get_list_columns( $schema_name, $table_name, $label_type, $setname = 'default' ) {
41 $index = "$schema_name.$table_name.$label_type.$setname";
42 if ( ! isset( self::$cached_list_columns[ $index ] ) ) {
43 self::$cached_list_columns[ $index ] = new WPDP_List_Columns( $schema_name, $table_name, $label_type, $setname );
44 }
45
46 return self::$cached_list_columns[ $index ];
47 }
48
49 }
50
51 }
52