Meta Data
Over at fishrod we’re developing our new CMS based on the new Zend Framework 1.7 (biting our nails for 2.0 to be released so we can relax for at least 3 months). One of the issues that always arises when developing a Content Management System for our clients is the amount of flexibility we want to offer them, and how generic the CMS has to be whilst still being flexible.
It’s fun coming up with a long list of fields to add to a database, but when clients suddenly want a header image for each page, testimonials, pod cast links (the list goes on) adding new fields to a database suddenly becomes very tedious. Enter, meta data!
For example, metadata would document data about data elements or attributes, (name, size, data type, etc) and data about records or data structures (length, fields, columns, etc) and data about data (where it is located, how it is associated, ownership, etc.). Metadata may include descriptive information about the context, quality and condition, or characteristics of the data.
Meta data in short is a nice way to describe data, meta data can contain absoloutly anything, and the cool thing about it is that we don’t have to modify table structures if we want to add a new non-generic field to a page or post. What’s even better is that you can index this meta data for searching with the help of the Zend Search Lucene component.
Meta data is however a double edged sword. If the tables aren’t structured correctly you will make the simple mistake of having one extra table for every table you want meta data associated to. An example being.
By removing the urge to create relational tables and create referential integrity in your database (doing the right thing), you can create a generic meta data table for everything!
Now all you need to do is create a metadata model in your application. The table name is simply your model name, and the foreign_id is simply the id of the row in your foreign table. Now if only you could create a view to lookup the table rows and show all of it’s metadata.
| Print article | This entry was posted by Gavin Williams on December 19, 2008 at 3:22 am, and is filed under PHP. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
No comments yet.
No trackbacks yet.
There has to be an easier way :(
about 6 months ago - No comments
So I’m working on a project, and I want to find all of the rows that don’t have a row in it’s related table using Zend_Db_Table_Select… Simple right? Not really . In theory this would be the query that I would write… SELECT author.id FROM author LEFT JOIN project ON project.author_id = author.id WHERE project.author_id
Zend_Acl + Zend_Auth + Zend_Controller_Plugin = HAPPY!
about 1 year ago - 14 comments
Ok, so after playing around with Zend_Acl for what seems like forever I’ve finally cracked what feels like the perfect marriage between Zend_Acl, Zend_Auth and an application. You may ask yourself, why the fuck is it so hard? The simple answer is this… Zend_Acl was designed in such a way that it does not require
Non-existant fields Zend_Db_Table_Abstract
about 1 year ago - No comments
I’d run into a problem in the Zend Table where when inserting data from a form, if a field didn’t exist in the database ZF would crap out with an exception. Having to unset posted variables I didn’t need, meant more typing, more typing meant more unnecessary code. I found the easiest way to get
Zend_Acl Db Storage
about 2 years ago - 1 comment
I’ve spent the last few hours trying to extend Zend_Acl_Role_Registry and Zend_Acl to support Db storage, when it just hit me what I’m actually trying to do, and a much easier way to do it! Zend_Acl Storage Mechanism Zend_Acl doesn’t store your ACL’s and ARO’s it simply holds it at run time and leaves it
Zend Framework and DoJo
about 2 years ago - 31 comments
I pretty much wet my self when ZF announced that they’d be integrating Dojo with the next iteration, and low and behold the first RC was made publicly available a few days ago. I literally dived in head first today, only to find the documentation was some what lacking. I don’t think the documentation is

