Archive for December, 2008
Eclipse Shortcuts
Dec 20th
Right clicking to create new table classes in Zend Studio for Eclipse can get very annoying. The best solution is to create shortcut for it. To do this:
- open up preferences (cmd + , if you’re on a mac).
- type in “keys” without the quotation marks.
- to the right enter “Zend Table” into the “type filter text” field.
- You’ll see the “New (New Wizard: Zend Table)” command.
- Click on it
- Click on the binding text box and press your command keys.
Hope that speeds things up a little!
Non-existant fields Zend_Db_Table_Abstract
Dec 20th
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 this is by overriding the insert method in my extended App_Db_Table_Abstract class. Here’s what my new insert method looks like.
public function insert($data, $skip = true){
if($skip === true){
$oldData = $data;
$data = array();
foreach($this->info('metadata') as $key => $value){
if(isset($oldData[$key])){
$data[$key] = $oldData[$key];
}
}
}
parent::insert($data);
}
The method takes two parameters, the data ($data) and a Boolean value ($skip). Skip defaults to true, so I don’t need to add this parameter to every call to insert, it’s also there in case I don’t want to skip my data.
It then iterates through the table meta data, which contains the field names for the table, checks to see if the key exists in the data from the form. If the field exists in the array then it’s added to the new data array.
Finally the parent insert method is called, bobs your uncle.
In case you’re wondering, I’ve subclassed some of the Zend classes, this allows me to override methods to my liking.
Gavin Williams is dead
Dec 19th
No, not me, just my old blog, trying to maintain just one blog is tedious enough, but with the new fishrod site and it’s amazing blog, this and gavinwilliams.co.uk managing them is going to be a task and a half.
As of now gavinwilliams.co.uk now redirects to justanotherdeveloper.co.uk whilst the fishrod blog will aggregate data from both my blog and Siobhan Bentley’s (hopefully she’ll something decent to say every now and then).
Google Gets Social
Dec 8th
Online Mediation
Dec 8th
A decision by a number of UK internet providers to block a Wikipedia page showing an image of a naked girl has angered users of the popular site.
BBC NEWS | UK | Wikipedia child image censored
This just hit my RSS reader in flock. It’s quite interesting to know that ISP’s are actually blocking websites based on complaints from other people, are we going to see online mediators in the near future? I hope not! The internet’s the one place where we can freely share ideas and collaborate without mediation, we don’t need a virtual nanny state, we’re already being told what we can and can’t do in the real world!
Agile Development
Dec 8th
Working at Channel 4 I’ve been introduced to Agile Development, to sum it up in one sentence…
“It’s a way of working in a development team, where the specification for a project is constantly changing and the waterfall approach (you get a spec, build to it over a long period of time, get feedback and make amends) just doesn’t cut it.”
It’s a completelty different way of working, and it’s full of terms which I would say were thought up by some drunk developer, introducing words such as “brown bag”.
More >


