PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.75
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.75
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 5.5.43 All 159 releases
wp-data-access / WPDataAccess / Plugin_Table_Models / WPDP_Project_Model.php

WPDP_Project_Model.php in WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards 5.5.75, at WPDataAccess/Plugin_Table_Models/WPDP_Project_Model.php

53 lines 1.1 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 WPDataAccess\Plugin_Table_Models
7 */
8
9 namespace WPDataAccess\Plugin_Table_Models {
10
11 use WPDataAccess\WPDA;
12
13 /**
14 * Class WPDP_Project_Model
15 *
16 * Model for plugin table 'wpda_project'
17 *
18 * @author Peter Schulz
19 * @since 2.6.0
20 */
21 class WPDP_Project_Model extends WPDA_Plugin_Table_Base_Model {
22
23 const BASE_TABLE_NAME = 'wpda_project';
24
25 /**
26 * Method overwritten for different table name handling
27 *
28 * @return string Table name
29 */
30 public static function get_base_table_name() {
31 static::check_base_table_name();
32
33 global $wpdb;
34 return $wpdb->prefix . static::BASE_TABLE_NAME;
35 }
36
37 public static function get_project_list() {
38 global $wpdb;
39 return $wpdb->get_results(
40 $wpdb->prepare(
41 'SELECT * FROM `%1s` ORDER BY project_name', // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders
42 array(
43 WPDA::remove_backticks( self::get_base_table_name() ),
44 )
45 ),
46 'ARRAY_A'
47 ); // phpcs:ignore Standard.Category.SniffName.ErrorCode
48 }
49
50 }
51
52 }
53