1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* \AppserverIo\Doppelgaenger\Interfaces\MapInterface |
5
|
|
|
* |
6
|
|
|
* NOTICE OF LICENSE |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
9
|
|
|
* that is available through the world-wide-web at this URL: |
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
11
|
|
|
* |
12
|
|
|
* PHP version 5 |
13
|
|
|
* |
14
|
|
|
* @author Bernhard Wick <[email protected]> |
15
|
|
|
* @copyright 2015 TechDivision GmbH - <[email protected]> |
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
17
|
|
|
* @link https://github.com/appserver-io/doppelgaenger |
18
|
|
|
* @link http://www.appserver.io/ |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
namespace AppserverIo\Doppelgaenger\Interfaces; |
22
|
|
|
|
23
|
|
|
use AppserverIo\Doppelgaenger\Entities\Definitions\Structure; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* An interface defining the functionality of any possible map class |
27
|
|
|
* |
28
|
|
|
* @author Bernhard Wick <[email protected]> |
29
|
|
|
* @copyright 2015 TechDivision GmbH - <[email protected]> |
30
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
31
|
|
|
* @link https://github.com/appserver-io/doppelgaenger |
32
|
|
|
* @link http://www.appserver.io/ |
33
|
|
|
*/ |
34
|
|
|
interface MapInterface |
35
|
|
|
{ |
36
|
|
|
/** |
37
|
|
|
* Will return all entries within a map. If needed only entries of contracted |
38
|
|
|
* structures will be returned. |
39
|
|
|
* |
40
|
|
|
* @param boolean $contracted Do we only want entries containing contracts? |
41
|
|
|
* |
42
|
|
|
* @return mixed |
43
|
|
|
*/ |
44
|
|
|
public function getEntries($contracted = false); |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Will add a structure entry to the map. |
48
|
|
|
* |
49
|
|
|
* @param \AppserverIo\Doppelgaenger\Entities\Definitions\Structure $structure The structure to add |
50
|
|
|
* |
51
|
|
|
* @return bool |
52
|
|
|
*/ |
53
|
|
|
public function add(Structure $structure); |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Do we have an entry for the given identifier |
57
|
|
|
* |
58
|
|
|
* @param string $identifier The identifier of the entry we try to find |
59
|
|
|
* |
60
|
|
|
* @return bool |
61
|
|
|
*/ |
62
|
|
|
public function entryExists($identifier); |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Will update a given structure. |
66
|
|
|
* If the entry does not exist we will create it |
67
|
|
|
* |
68
|
|
|
* @param \AppserverIo\Doppelgaenger\Entities\Definitions\Structure $structure The structure to update |
69
|
|
|
* |
70
|
|
|
* @return void |
71
|
|
|
* |
72
|
|
|
* TODO implement this in the implementing classes |
|
|
|
|
73
|
|
|
*/ |
74
|
|
|
public function update(Structure $structure = null); |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Will return the entry specified by it's identifier. |
78
|
|
|
* If none is found, false will be returned. |
79
|
|
|
* |
80
|
|
|
* @param string $identifier The identifier of the entry we try to find |
81
|
|
|
* |
82
|
|
|
* @return boolean|\AppserverIo\Doppelgaenger\Entities\Definitions\Structure |
83
|
|
|
*/ |
84
|
|
|
public function getEntry($identifier); |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* Checks if the entry for a certain structure is recent if one was specified. |
88
|
|
|
* If not it will check if the whole map is recent. |
89
|
|
|
* |
90
|
|
|
* @param null|string $identifier The identifier of the entry we try to find |
91
|
|
|
* |
92
|
|
|
* @return boolean |
93
|
|
|
*/ |
94
|
|
|
public function isRecent($identifier = null); |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* Will return an array of all entry identifiers which are stored in this map. |
98
|
|
|
* We might filter by entry type |
99
|
|
|
* |
100
|
|
|
* @param string|null $type The type to filter by |
101
|
|
|
* |
102
|
|
|
* @return array |
103
|
|
|
*/ |
104
|
|
|
public function getIdentifiers($type = null); |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* Will return an array of all files which are stored in this map. |
108
|
|
|
* Will include the full path if $fullPath is true. |
109
|
|
|
* |
110
|
|
|
* @param boolean $fullPath Do we need the full path? |
111
|
|
|
* |
112
|
|
|
* @return array |
113
|
|
|
*/ |
114
|
|
|
public function getFiles($fullPath = true); |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* Removes an entry from the map of structures. |
118
|
|
|
* |
119
|
|
|
* @param null|string $identifier The identifier of the entry we try to find |
120
|
|
|
* |
121
|
|
|
* @return boolean |
122
|
|
|
*/ |
123
|
|
|
public function remove($identifier); |
124
|
|
|
} |
125
|
|
|
|