1 | <?php |
||
25 | class Locations extends ArrayCollection |
||
26 | { |
||
27 | |||
28 | /** |
||
29 | * Adds a location at the end of the collection if it does not already exist. |
||
30 | * |
||
31 | * @param mixed $location The location to add. |
||
32 | * |
||
33 | * @return boolean Whether the location was added or not. |
||
34 | */ |
||
35 | 31 | public function add($location) |
|
43 | |||
44 | /** |
||
45 | * Check whether a given location is already registered. |
||
46 | * |
||
47 | * For two locations to be equal, both their path and their extensions must be the same. |
||
48 | * |
||
49 | * @since 0.1.1 |
||
50 | * |
||
51 | * @param Location $location Location to check the existence of. |
||
52 | * |
||
53 | * @return bool Whether the location is already registered or not. |
||
54 | * |
||
55 | * @throws InvalidLocation If the location is not valid. |
||
56 | */ |
||
57 | 31 | public function hasLocation($location) |
|
72 | } |
||
73 |