1 | <?php |
||
4 | class PdoCouponFactory |
||
5 | { |
||
6 | |||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | public $php_class; |
||
11 | |||
12 | /** |
||
13 | * @var callable |
||
14 | */ |
||
15 | public $coupon_sheet_factory; |
||
16 | |||
17 | |||
18 | /** |
||
19 | * @var PDOStatement |
||
20 | */ |
||
21 | public $stmt; |
||
22 | |||
23 | |||
24 | /** |
||
25 | * @var string[] |
||
26 | */ |
||
27 | protected static $coupon_fields_default = array( |
||
28 | 'id', |
||
29 | 'code', |
||
30 | 'coupon_sheet_id AS coupon_sheet', |
||
31 | ); |
||
32 | |||
33 | /** |
||
34 | * @var string[] |
||
35 | */ |
||
36 | public static $coupon_fields = array(); |
||
37 | |||
38 | /** |
||
39 | * @param \PDO $pdo |
||
40 | * @param string $coupons_table |
||
41 | * @param callable $coupon_sheet_factory |
||
42 | * @param string $php_class |
||
43 | */ |
||
44 | public function __construct( \PDO $pdo, $coupons_table, callable $coupon_sheet_factory, $php_class = null) |
||
65 | |||
66 | /** |
||
67 | * @param string|CouponInterface $code |
||
68 | * @return CouponInterface[] |
||
69 | */ |
||
70 | public function __invoke( $code ) |
||
90 | |||
91 | } |
||
92 | |||
93 |