1 | <?php |
||
24 | abstract class BaseDestination implements DestinationInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var BackupInterface[] |
||
28 | */ |
||
29 | protected $backups; |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | public function getIterator() |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 14 | public function get($name) |
|
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | 16 | public function has($name) |
|
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | 2 | public function all() |
|
71 | { |
||
72 | 2 | if (is_null($this->backups)) { |
|
73 | 2 | $this->load(); |
|
74 | 2 | } |
|
75 | |||
76 | 2 | return $this->backups; |
|
77 | } |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | 6 | public function count() |
|
90 | |||
91 | /** |
||
92 | * Load backups from destination. |
||
93 | * |
||
94 | * @return BackupInterface[] |
||
95 | */ |
||
96 | abstract protected function load(); |
||
97 | } |
||
98 |