ZF-3771: Custom metadata

Description

Allow possibility to add our custom metadata. 1. add to Zend_Db_Table_Abstract


/**
 * @return array
 */
protected function _setupCustomMetadata($metadata) {
    return $metadata,
}
  1. call this function before saving cache:

// Fetch metadata from the adapter's describeTable() method
$metadata = $this->_db->describeTable($this->_name, $this->_schema);
// Add custom metadata
$metadata = $this->_setupCustomMetadata($metadata);
// If $this has a metadata cache, then cache the metadata
if (null !== $this->_metadataCache && !$this->_metadataCache->save($metadata, $cacheId)) {

Comments

What is the use case here? The idea currently is that METADATA comes from the actual database.

-ralph

In my case, I read table comments and columns comments from the database and I save this in other cache file.

You can do this already by extending Zend_Db_Table_Abstract and inheriting from your extending class:


abstract class My_Db_Table_Abstract extends Zend_Db_Table_Abstract
{
    protected function _setupMetadata()
    {
        /* custom functionality here */
    }
}

The better solution to this is in ZF-2510. With an explicity getter for metadata, you'd simply override that method.

Closing, and linking to ZF-2510 as a duplicate.

Changing issues in preparation for the 1.7.0 release.