ver. 0.269: ShopPaymentMethod refactor + Apilo keepalive
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
<?
|
||||
<?php
|
||||
namespace shop;
|
||||
|
||||
class PaymentMethod implements \ArrayAccess
|
||||
{
|
||||
// lista dostępnych form płatności
|
||||
static public function method_list()
|
||||
private static function repo(): \Domain\PaymentMethod\PaymentMethodRepository
|
||||
{
|
||||
global $mdb;
|
||||
return $mdb -> select( 'pp_shop_payment_methods', '*', [ 'status' => 1 ] );
|
||||
return new \Domain\PaymentMethod\PaymentMethodRepository( $mdb );
|
||||
}
|
||||
|
||||
// lista dostepnych form platnosci
|
||||
static public function method_list()
|
||||
{
|
||||
return self::repo()->allActive();
|
||||
}
|
||||
|
||||
// get_apilo_payment_method_id
|
||||
static public function get_apilo_payment_method_id( $payment_method_id )
|
||||
{
|
||||
global $mdb;
|
||||
return $mdb -> get( 'pp_shop_payment_methods', 'apilo_payment_type_id', [ 'id' => $payment_method_id ] );
|
||||
return self::repo()->getApiloPaymentTypeId( (int)$payment_method_id );
|
||||
}
|
||||
|
||||
public function offsetExists( $offset )
|
||||
@@ -35,4 +40,4 @@ class PaymentMethod implements \ArrayAccess
|
||||
{
|
||||
unset( $this -> $offset );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user