ZF-3771: Custom metadata

Issue Type: Improvement Created: 2008-07-27T03:06:20.000+0000 Last Updated: 2008-11-13T14:10:21.000+0000 Status: Resolved Fix version(s): - 1.7.0 (17/Nov/08)

Reporter: Mickael Perraud (mikaelkael) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Db_Table

Related issues: - ZF-2510



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

<pre class="highlight">
 * @return array
protected function _setupCustomMetadata($metadata) {
    return $metadata,
  1. call this function before saving cache:
<pre class="highlight">
// 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)) {


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.


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:

<pre class="highlight">
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.

Posted by Wil Sinclair (wil) on 2008-11-13T14:10:21.000+0000

Changing issues in preparation for the 1.7.0 release.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.