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.
No comments yet.
No trackbacks yet.
There has to be an easier way :(
February 18, 2010 - 1:37 am
Tags: join, left join, model, Zend Framework, Zend_Db_Table_Abstract
Posted in PHP, Zend Framework | 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!
August 3, 2009 - 3:43 pm
Tags: acl, aro, cms, Design Patterns, PHP, tips, Zend Framework
Posted in PHP, Zend Framework | 8 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 any [...]
Non-existant fields Zend_Db_Table_Abstract
December 20, 2008 - 3:57 am
Tags: Zend Framework, Zend_Db_Table_Abstract
Posted in PHP, Zend Framework | 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 around [...]
Zend_Acl Db Storage
July 25, 2008 - 4:20 pm
Tags: acl, aro, Zend Framework
Posted in PHP, Zend Framework | No Comments
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 to the [...]
Zend Framework and DoJo
July 23, 2008 - 5:29 pm
Tags: Dojo, Javascript, PHP, toolkit, Zend Framework
Posted in Dojo, Javascript, PHP, Zend Framework | 29 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 quite [...]

