Cache.php 1.64 KB
Newer Older
doctrine's avatar
doctrine committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
<?php
interface iDoctrine_Cache {
    public function store(Doctrine_Record $record);
    public function clean();
    public function delete($id);
    public function fetch($id);
    public function exists($id);
}
class Doctrine_Cache implements iDoctrine_Cache {
    /**
     * implemented by child classes
     * @param Doctrine_Record $record
     * @return boolean
     */
    public function store(Doctrine_Record $record) {
        return false;
    }
    /**
     * implemented by child classes
     * @return boolean
     */
    public function clean() {
        return false;
    }
    /**
     * implemented by child classes
     * @return boolean
     */
    public function delete($id) {
        return false;
    }
    /**
     * implemented by child classes
     * @throws InvalidKeyException
     * @return Doctrine_Record                      found Data Access Object
     */
    public function fetch($id) {
        throw new InvalidKeyException();
    }
    /**
     * implemented by child classes
     * @param array $keys
     * @return boolean
     */
    public function fetchMultiple($keys) {
        return false;                                     	
    }
    /**
     * implemented by child classes
     * @param integer $id
     * @return boolean
     */
    public function exists($id) {
        return false;
    }
    /**
     * implemented by child classes
     */
    public function deleteMultiple($keys) {
        return 0;
    }
    /**
     * implemented by child classes
     * @return integer
     */
    public function deleteAll() {
        return 0;
    }

}
?>