at path:
ROOT
/
wp-content
/
plugins
/
tutor
/
models
/
BillingModel.php
run:
R
W
Run
BaseModel.php
7.96 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
BillingModel.php
2.07 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
CartItemModel.php
560 By
2026-04-14 05:34:27
R
W
Run
Delete
Rename
CartModel.php
5.65 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
CouponModel.php
33.61 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
CourseModel.php
33.71 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
LessonModel.php
5.22 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
OrderActivitiesModel.php
5.26 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
OrderItemMetaModel.php
3.13 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
OrderItemModel.php
562 By
2026-04-14 05:34:27
R
W
Run
Delete
Rename
OrderMetaModel.php
4.52 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
OrderModel.php
57.55 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
QuizModel.php
33.33 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
UserModel.php
2.42 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
WithdrawModel.php
6.13 KB
2026-04-14 05:34:27
R
W
Run
Delete
Rename
error_log
up
📄
BillingModel.php
Save
<?php /** * Billing Model * * @package Tutor\Models * @author Themeum <support@themeum.com> * @link https://themeum.com * @since 3.0.0 */ namespace Tutor\Models; use Tutor\Helpers\QueryHelper; /** * Billing model class for performing billing functionalities */ class BillingModel { /** * Fillable fields * * @var array */ private $fillable_fields = array( 'billing_first_name', 'billing_last_name', 'billing_email', 'billing_phone', 'billing_zip_code', 'billing_address', 'billing_country', 'billing_state', 'billing_city', ); /** * Required fields * * @var array */ private $required_fields = array( 'billing_first_name', 'billing_last_name', 'billing_email', 'billing_phone', 'billing_zip_code', 'billing_address', 'billing_country', 'billing_state', 'billing_city', ); /** * Get fillable fields * * @return array */ public function get_fillable_fields() { return $this->fillable_fields; } /** * Get required fields * * @return array */ public function get_required_fields() { return $this->required_fields; } /** * Insert billing info * * @param array $data Bulling info data. * * @return int The ID of the inserted row on success, or 0 on failure. */ public function insert( $data ) { global $wpdb; return QueryHelper::insert( "{$wpdb->prefix}tutor_customers", $data, ); } /** * Update billing info * * @param array $data Bulling info data. * @param array $where Where condition. * * @return bool True on success, false on failure. */ public function update( $data, $where ) { global $wpdb; return QueryHelper::update( "{$wpdb->prefix}tutor_customers", $data, $where, ); } /** * Get billing info * * @param int $user_id User ID. * * @return object|false The billing info as an object if found, or false if not found. */ public function get_info( $user_id ) { global $wpdb; $billing_info = QueryHelper::get_row( "{$wpdb->prefix}tutor_customers", array( 'user_id' => $user_id, ), 'id' ); return $billing_info; } }