OrderPaymentMethod   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A order() 0 3 1
A getPriceWithoutTaxNumberFormat() 0 3 1
A paymentMethod() 0 3 1
A getPriceWithTaxNumberFormat() 0 3 1
1
<?php 
2
3
namespace Hideyo\Ecommerce\Framework\Services\Order\Entity;
4
5
use Hideyo\Ecommerce\Framework\Services\BaseModel;
6
7
class OrderPaymentMethod extends BaseModel
8
{
9
    /**
10
     * The database table used by the model.
11
     *
12
     * @var string
13
     */    
14
    protected $table = 'order_payment_method';
15
16
    // Add the 'avatar' attachment to the fillable array so that it's mass-assignable on this model.
17
    protected $fillable = ['order_id', 'payment_method_id', 'title', 'price_with_tax', 'price_without_tax', 'tax_rate', 'tax_rate_id', 'percent_of_total', 'payment_external'];
18
19
    public function order()
20
    {
21
        return $this->belongsTo('Hideyo\Ecommerce\Framework\Services\Order\Entity\Order');
22
    }
23
24
    public function paymentMethod()
25
    {
26
        return $this->belongsTo('Hideyo\Ecommerce\Framework\Services\paymentMethod\Entity\paymentMethod');
27
    }
28
29
    public function getPriceWithTaxNumberFormat()
30
    {
31
        return number_format($this->price_with_tax, 2);
32
    }
33
34
    public function getPriceWithoutTaxNumberFormat()
35
    {
36
        return number_format($this->price_without_tax, 2);
37
    }
38
}