Files
apache
wp-content
mu-plugins
plugins
activitypub
audioigniter
authldap
companion-auto-update
disable-wordpress-core-update
easy-digital-downloads
assets
includes
adjustments
admin
api
blocks
cart
checkout
compat
currency
customers
database
engine
class-base.php
class-column.php
class-compare.php
class-date.php
class-meta.php
class-query.php
class-row.php
class-schema.php
class-table.php
queries
rows
schemas
tables
NotificationsDB.php
README.md
downloads
emails
extensions
gateways
libraries
logs
models
notes
orders
payments
reports
traits
users
utils
EDD_SL_Plugin_Updater.php
actions.php
ajax-functions.php
class-base-object.php
class-component.php
class-easy-digital-downloads.php
class-edd-cache-helper.php
class-edd-cli.php
class-edd-cron.php
class-edd-customer-query.php
class-edd-customer.php
class-edd-db-customer-meta.php
class-edd-db-customers.php
class-edd-db.php
class-edd-discount.php
class-edd-download.php
class-edd-fees.php
class-edd-html-elements.php
class-edd-license-handler.php
class-edd-logging.php
class-edd-register-meta.php
class-edd-roles.php
class-edd-session.php
class-edd-stats.php
class-stats.php
class-structured-data.php
class-utilities.php
compat-functions.php
component-functions.php
country-functions.php
customer-functions.php
date-functions.php
deprecated-functions.php
deprecated-hooks.php
discount-functions.php
download-functions.php
error-tracking.php
formatting.php
install.php
interface-edd-exception.php
mime-types.php
misc-functions.php
plugin-compatibility.php
post-types.php
privacy-functions.php
process-download.php
process-purchase.php
query-filters.php
refund-functions.php
scripts.php
shortcodes.php
tax-functions.php
template-actions.php
template-functions.php
theme-compatibility.php
user-functions.php
widgets.php
languages
templates
easy-digital-downloads.php
license.txt
readme.txt
uninstall.php
gitium
gp-premium
jetpack-protect
menu-icons
simple-local-avatars
smtp-mailer
two-factor
wp-piwik
wp-webauthn
index.php
themes
index.php
.dbsetup
.gitignore
htaccess
php.ini

66 lines
1.4 KiB
PHP

<?php
/**
* Base Custom Database Table Row Class.
*
* @package Database
* @subpackage Row
* @copyright Copyright (c) 2020
* @license https://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0.0
*/
namespace EDD\Database;
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
/**
* Base database row class.
*
* This class exists solely for other classes to extend (and to encapsulate
* database schema changes for those objects) to help separate the needs of the
* application layer from the requirements of the database layer.
*
* For example, if a database column is renamed or a return value needs to be
* formatted differently, this class will make sure old values are still
* supported and new values do not conflict.
*
* @since 1.0.0
*/
class Row extends Base {
/**
* Construct a database object.
*
* @since 1.0.0
*
* @param mixed Null by default, Array/Object if not
*/
public function __construct( $item = null ) {
if ( ! empty( $item ) ) {
$this->init( $item );
}
}
/**
* Initialize class properties based on data array.
*
* @since 1.0.0
*
* @param array $data
*/
private function init( $data = array() ) {
$this->set_vars( $data );
}
/**
* Determines whether the current row exists.
*
* @since 1.0.0
*
* @return bool
*/
public function exists() {
return ! empty( $this->id );
}
}