| 1 | <?php |
||
| 10 | abstract class AbstractCollection implements CollectionInterface |
||
| 11 | { |
||
| 12 | protected $atoms = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Creates a new atom within the collection. |
||
| 16 | * |
||
| 17 | * @param string $name The name of the atom to create. |
||
| 18 | * @return mixed The atom created. |
||
| 19 | */ |
||
| 20 | 1 | public function create($name) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * Retrieves an atom by name. |
||
| 29 | * |
||
| 30 | * @param string $name The name of the atom to retrieve. |
||
| 31 | * @return mixed The atom retrieved if it exists, false otherwise. |
||
| 32 | */ |
||
| 33 | 2 | public function get($name) |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Adds a value to the collection. |
||
| 40 | * |
||
| 41 | * @param string $name The name of the atom to add to the collection. |
||
| 42 | * @param string $value The value to add to the collection. |
||
| 43 | * @return mixed The value added to the collection. |
||
| 44 | */ |
||
| 45 | 1 | public function set($name, $value) |
|
| 51 | |||
| 52 | /** |
||
| 53 | * Checks to see if an atom already exists within the collection. |
||
| 54 | * |
||
| 55 | * @param string $name The name of the atom. |
||
| 56 | * @return boolean True if the atom exists, false otherwise. |
||
| 57 | */ |
||
| 58 | 2 | public function exists($name) |
|
| 62 | } |
||
| 63 |