Initial Commit
This commit is contained in:
121
inc/database/sites/class-site-query.php
Normal file
121
inc/database/sites/class-site-query.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* Class used for querying products.
|
||||
*
|
||||
* @package WP_Ultimo
|
||||
* @subpackage Database\Sites
|
||||
* @since 2.0.0
|
||||
*/
|
||||
|
||||
namespace WP_Ultimo\Database\Sites;
|
||||
|
||||
use WP_Ultimo\Database\Engine\Query;
|
||||
|
||||
// Exit if accessed directly
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
/**
|
||||
* Class used for querying products.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
class Site_Query extends Query {
|
||||
|
||||
/**
|
||||
* Table prefix, including the site prefix.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix = '';
|
||||
|
||||
/** Table Properties ******************************************************/
|
||||
|
||||
/**
|
||||
* Name of the database table to query.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
protected $table_name = 'blogs';
|
||||
|
||||
/**
|
||||
* String used to alias the database table in MySQL statement.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
protected $table_alias = 's';
|
||||
|
||||
/**
|
||||
* Name of class used to setup the database schema
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
protected $table_schema = '\\WP_Ultimo\\Database\\Sites\\Sites_Schema';
|
||||
|
||||
/** Item ******************************************************************/
|
||||
|
||||
/**
|
||||
* Name for a single item
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
protected $item_name = 'blog';
|
||||
|
||||
/**
|
||||
* Plural version for a group of items.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
protected $item_name_plural = 'blogs';
|
||||
|
||||
/**
|
||||
* Callback function for turning IDs into objects
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access public
|
||||
* @var mixed
|
||||
*/
|
||||
protected $item_shape = '\\WP_Ultimo\\Models\\Site';
|
||||
|
||||
/**
|
||||
* Group to cache queries and queried items in.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access public
|
||||
* @var string
|
||||
*/
|
||||
protected $cache_group = 'sites';
|
||||
|
||||
/**
|
||||
* If we should use a global cache group.
|
||||
*
|
||||
* @since 2.1.2
|
||||
* @var bool
|
||||
*/
|
||||
protected $global_cache = true;
|
||||
|
||||
/**
|
||||
* Sets up the customer query, based on the query vars passed.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access public
|
||||
*
|
||||
* @param string|array $query Array of query arguments.
|
||||
*/
|
||||
public function __construct($query = array()) {
|
||||
|
||||
parent::__construct($query);
|
||||
|
||||
} // end __construct;
|
||||
|
||||
} // end class Site_Query;
|
Reference in New Issue
Block a user