GiftVoucher::allowed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Resova\Models;
4
5
use Resova\Model;
6
7
/**
8
 * The gift voucher object
9
 * Gift vouchers are types of gifts that can be purchased by customers,
10
 * ie "Gift voucher for £10.00", which when purchased will generated
11
 * a redeemable gift code.
12
 *
13
 * @codeCoverageIgnore
14
 * @package Resova\Models
15
 */
16
class GiftVoucher extends Model
17
{
18
    /**
19
     * List of allowed fields
20
     *
21
     * @return array
22
     */
23
    public function allowed(): array
24
    {
25
        return [
26
            'id'           => 'int',    // The unique id for the object.
27
            'name'         => 'string', // The name of the gift voucher.
28
            'amount'       => 'float',  // The purchase amount for this gift voucher.
29
            'voucher_type' => 'string', // Can be: value or spaces.
30
            'discount'     => 'float',  // The discountable amount for a gift code belonging to this voucher.
31
            'description'  => 'string', // The description of how the gift voucher is applied.
32
            'status'       => 'bool',   // True if the gift voucher is active.
33
        ];
34
    }
35
}
36