1 | <?php |
||
13 | class ApiTransactionRepository implements TransactionRepositoryInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var ConnectionInterface |
||
17 | */ |
||
18 | private $connection; |
||
19 | |||
20 | /** |
||
21 | * ApiTransactionRepository constructor. |
||
22 | * @param ConnectionInterface $connection |
||
23 | */ |
||
24 | function __construct(ConnectionInterface $connection) |
||
28 | |||
29 | /** |
||
30 | * @param string $id |
||
31 | * @return Transaction |
||
32 | * @throws TransactionException when transaction with the specified ID |
||
33 | * does not exists |
||
34 | */ |
||
35 | public function findById($id) |
||
51 | |||
52 | /** |
||
53 | * @inheritdoc |
||
54 | */ |
||
55 | public function insert($transaction) |
||
59 | |||
60 | /** |
||
61 | * @inheritdoc |
||
62 | */ |
||
63 | public function create($id, $merchant, $parameters) |
||
70 | |||
71 | /** |
||
72 | * @inheritdoc |
||
73 | */ |
||
74 | public function save($transaction) |
||
89 | |||
90 | private function callWithoutAuth(\Closure $function) |
||
99 | |||
100 | /** |
||
101 | * @param $data |
||
102 | * @return Transaction |
||
103 | */ |
||
104 | protected function instantiate($data) |
||
117 | } |
||
118 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.