Skip to content

Commit

Permalink
Update key model
Browse files Browse the repository at this point in the history
  • Loading branch information
kawsarahmedr committed Aug 15, 2024
1 parent 92ad68f commit 1a9de93
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Models/Key.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Key extends Model {
'activation_count' => 0,
'order_id' => 0,
'vendor_id' => 0,
'subscription_id' => 0,
'status' => 'available',
'validity' => 0,
'order_date' => '',
Expand Down Expand Up @@ -330,6 +331,32 @@ public function set_vendor_id( $vendor_id ) {
$this->set_prop( 'vendor_id', absint( $vendor_id ) );
}

/**
* Get the subscription id.
*
* @param string $context What the value is for. Valid values are 'view' and 'edit'.
*
* @since 1.4.6
*
* @return int
*/
public function get_subscription_id( $context = 'edit' ) {
return $this->get_prop( 'subscription_id', $context );
}

/**
* Set the subscription id.
*
* @param int $subscription_id Subscription id.
*
* @since 2.0.1
*
* @return void
*/
public function set_subscription_id( $subscription_id ) {
$this->set_prop( 'subscription_id', absint( $subscription_id ) );
}

/**
* Get the status.
* Possible values: 'active', 'inactive', 'expired', 'cancelled', 'pending', 'failed', 'refunded', 'deleted'.
Expand Down

0 comments on commit 1a9de93

Please sign in to comment.