PersistenceInterface.php 1.75 KB
Newer Older
1
<?php
2 3
namespace T3o\TerFe2\Persistence;

4 5
/*
 * This file is part of the TYPO3 CMS project.
6
 *
7 8 9
 * It is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, either version 2
 * of the License, or any later version.
10
 *
11 12
 * For the full copyright and license information, please read the
 * LICENSE.txt file that was distributed with this source code.
13
 *
14 15
 * The TYPO3 project - inspiring people to share!
 */
16 17 18 19

/**
 * Persistence handler interface
 */
20
interface PersistenceInterface
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
{

    /**
     * Load content
     */
    public function load();

    /**
     * Save content
     */
    public function save();

    /**
     * Set value
     *
     * @param string $key Name of the value
     * @param mixed $value Value content
     */
    public function set($key, $value);

    /**
     * Add value
     *
     * @param string $key Name of the value
     * @param mixed $value Value content
     */
    public function add($key, $value);

    /**
     * Add multiple values
     *
52
     * @param array $values Key <-> value pairs
53 54 55 56 57 58 59
     */
    public function addMultiple(array $values);

    /**
     * Check if content contains given key
     *
     * @param string $key Name of the value
60
     * @return bool TRUE if exists
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
     */
    public function has($key);

    /**
     * Get value
     *
     * @param string $key Name of the value
     * @return mixed Value content
     */
    public function get($key);

    /**
     * Get all values
     *
     * @return array Key <-> value pairs
     */
    public function getAll();

    /**
     * Remove a value
     *
     * @param string $key Name of the value
     */
    public function remove($key);

    /**
     * Remove all values
     */
    public function removeAll();
}