| 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 |
|