How to use Zend_Cache Identifier ?

Posted by ArneRie on Stack Overflow See other posts from Stack Overflow or by ArneRie
Published on 2009-12-15T19:06:09Z Indexed on 2010/05/02 19:48 UTC
Read the original article Hit count: 207

Hi Folks,

i think iam getting crazy, iam trying to implement Zend_Cache to cache my database query. I know how it works and how to configure.

But i cant find a good way to set the Identifier for the cache entrys. I have an method wich search for records in my database (based on an array with search values).

/**
 * Find Record(s)
 * Returns one record, or array with objects
 *
 * @param array   $search Search columns => value
 * @param integer $limit  Limit results
 * @return array One record , or array with objects
 */
public function find(array $search, $limit = null)
{
    $identifier = 'NoIdea';

    if (!($data = $this->_cache->load($identifier))) {
        // fetch
        // save to cache with $identifier..
    }

But what kind of identifier can use in this situation?

© Stack Overflow or respective owner

Related posts about zend-cache

Related posts about zend-framework