<?php
 class vB_Entity_Paidsubscription extends vB_Entity implements Stringable { use vB_Trait_NoSerialize; public string $currency; public function __construct( string $currency, public float $cost, public bool $recurring, public float $duration, public string $duration_units, public int $subscriptionid, public int $subscriptionsubid, public int $userid, public string $vbhash ) { $this->currency = strtoupper($currency); } public static function createFromArray(array $dbrecord) : static { return new vB_Entity_Paidsubscription( $dbrecord['currency'], $dbrecord['cost'], $dbrecord['recurring'], $dbrecord['duration'], $dbrecord['duration_units'], $dbrecord['subscriptionid'], $dbrecord['subscriptionsubid'], $dbrecord['userid'], $dbrecord['vbhash'] ); } public function __toString(): string { return json_encode([ 'currency' => $this->currency, 'cost' => $this->cost, 'recurring' => $this->recurring, 'duration' => $this->duration, 'duration_units' => $this->duration_units, 'subscriptionid' => $this->subscriptionid, 'subscriptionsubid' => $this->subscriptionsubid, 'userid' => $this->userid, 'vbhash' => $this->vbhash, ]); } } 