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,
}
- 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
Posted by Ralph Schindler (ralph) on 2008-07-29T14:12:11.000+0000
What is the use case here? The idea currently is that METADATA comes from the actual database.
-ralph
Posted by Mickael Perraud (mikaelkael) on 2008-07-29T23:26:49.000+0000
In my case, I read table comments and columns comments from the database and I save this in other cache file.
Posted by Matthew Weier O'Phinney (matthew) on 2008-10-31T10:33:11.000+0000
You can do this already by extending Zend_Db_Table_Abstract and inheriting from your extending class:
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.
Posted by Wil Sinclair (wil) on 2008-11-13T14:10:21.000+0000
Changing issues in preparation for the 1.7.0 release.