Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| SubscriptionMapper | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | /** |
| 3 | * Jingga |
| 4 | * |
| 5 | * PHP Version 8.1 |
| 6 | * |
| 7 | * @package Modules\Billing\Models |
| 8 | * @copyright Dennis Eichhorn |
| 9 | * @license OMS License 2.0 |
| 10 | * @version 1.0.0 |
| 11 | * @link https://jingga.app |
| 12 | */ |
| 13 | declare(strict_types=1); |
| 14 | |
| 15 | namespace Modules\Billing\Models; |
| 16 | |
| 17 | use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; |
| 18 | |
| 19 | /** |
| 20 | * Mapper class. |
| 21 | * |
| 22 | * @package Modules\Billing\Models |
| 23 | * @license OMS License 2.0 |
| 24 | * @link https://jingga.app |
| 25 | * @since 1.0.0 |
| 26 | * |
| 27 | * @template T of Subscription |
| 28 | * @extends DataMapperFactory<T> |
| 29 | */ |
| 30 | final class SubscriptionMapper extends DataMapperFactory |
| 31 | { |
| 32 | /** |
| 33 | * Columns. |
| 34 | * |
| 35 | * @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}> |
| 36 | * @since 1.0.0 |
| 37 | */ |
| 38 | public const COLUMNS = [ |
| 39 | 'billing_subscription_id' => ['name' => 'billing_subscription_id', 'type' => 'int', 'internal' => 'id'], |
| 40 | 'billing_subscription_status' => ['name' => 'billing_subscription_status', 'type' => 'int', 'internal' => 'status'], |
| 41 | 'billing_subscription_start' => ['name' => 'billing_subscription_start', 'type' => 'DateTime', 'internal' => 'start'], |
| 42 | 'billing_subscription_end' => ['name' => 'billing_subscription_end', 'type' => 'DateTime', 'internal' => 'end'], |
| 43 | 'billing_subscription_price' => ['name' => 'billing_subscription_price', 'type' => 'Serializable', 'internal' => 'price'], |
| 44 | 'billing_subscription_quantity' => ['name' => 'billing_subscription_quantity', 'type' => 'int', 'internal' => 'quantity'], |
| 45 | 'billing_subscription_bill' => ['name' => 'billing_subscription_bill', 'type' => 'int', 'internal' => 'bill'], |
| 46 | 'billing_subscription_item' => ['name' => 'billing_subscription_item', 'type' => 'int', 'internal' => 'item'], |
| 47 | 'billing_subscription_autorenew' => ['name' => 'billing_subscription_autorenew', 'type' => 'bool', 'internal' => 'autoRenew'], |
| 48 | 'billing_subscription_client' => ['name' => 'billing_subscription_client', 'type' => 'int', 'internal' => 'client'], |
| 49 | ]; |
| 50 | |
| 51 | /** |
| 52 | * Primary field name. |
| 53 | * |
| 54 | * @var string |
| 55 | * @since 1.0.0 |
| 56 | */ |
| 57 | public const PRIMARYFIELD = 'billing_subscription_id'; |
| 58 | |
| 59 | /** |
| 60 | * Primary table. |
| 61 | * |
| 62 | * @var string |
| 63 | * @since 1.0.0 |
| 64 | */ |
| 65 | public const TABLE = 'billing_subscription'; |
| 66 | } |