src/lastfmapi/Lib/Cache.php
public function get($unique_vars)
    {
        if ($this->enabled == true) {
            $query = "SELECT expires, body FROM cache WHERE unique_vars='" . htmlentities(serialize($unique_vars), ENT_QUOTES, 'UTF-8') . "' LIMIT 1";
            if ($result = $this->db->query($query)) {
                if ($result->size() > 0) {
                    $row = $result->fetch();
                    if ($row['expires'] < time()) {
                        $this->del($unique_vars);
                        return false;
                    } else {
                        //print_r(unserialize(html_entity_decode($row['body'], ENT_QUOTES, 'UTF-8')));
                        return unserialize(html_entity_decode($row['body'], ENT_QUOTES, 'UTF-8'));
                    }
                } else {
                    return false;
                }
            } else {
                // TODO: Handle error
                return false;
            }
        } else {
            return false;
        }
    }
public function get($unique_vars)
    {
        if ($this->enabled == true) {
            $query = "SELECT expires, body FROM cache WHERE unique_vars='" . htmlentities(serialize($unique_vars), ENT_QUOTES, 'UTF-8') . "' LIMIT 1";
            if ($result = $this->db->query($query)) {
                if ($result->size() > 0) {
                    $row = $result->fetch();
                    if ($row['expires'] < time()) {
                        $this->del($unique_vars);
                        return false;
                    } else {
                        //print_r(unserialize(html_entity_decode($row['body'], ENT_QUOTES, 'UTF-8')));
                        return unserialize(html_entity_decode($row['body'], ENT_QUOTES, 'UTF-8'));
                    }
                } else {
                    return false;
                }
            } else {
                // TODO: Handle error
                return false;
            }
        } else {
            return false;
        }
    }
public function get ( $ unique_vars ) { if ( $ this -> enabled == true ) { $ query = "SELECT expires, body FROM cache WHERE unique_vars='" . htmlentities ( serialize ( $ unique_vars ) , ENT_QUOTES , 'UTF-8' ) . "' LIMIT 1" ; if ( $ result = $ this -> db -> query ( $ query ) ) { if ( $ result -> size ( ) > 0 ) { $ row = $ result -> fetch ( ) ; if ( $ row [ 'expires' ] < time ( ) ) { $ this -> del ( $ unique_vars ) ; return false ; } else { //print_r(unserialize(html_entity_decode($row['body'], ENT_QUOTES, 'UTF-8')));
 return unserialize ( html_entity_decode ( $ row [ 'body' ] , ENT_QUOTES , 'UTF-8' ) ) ; } } else { return false ; } } else { // TODO: Handle error
 return false ; } } else { return false ; } }
Searches the database for the cahce date. Returns an array if it exists or false if it doesn't
@access public
@param array $unique_vars Array of variables that are unique to this piece of cached data
@return string
Searches the database for the cahce date . Returns an array if it exists or false if it doesn t