Things that should be objects in Drupal #1: Content types

Published on Mon, 2009-06-15 - 11:23

Currently, defining the simplest content type in Drupal requires ~54 lines of 100% standard boilerplate code.

The reason Object Orientation would be good here is the simple concept of inheritance.

Very simply, my 54 lines of code could be replaced by something like:

class CampaignContentType extends NodeContentType {
  // Custom functionality here.

I think I'll go see if I can help Crell with his objective somehow :)

The comments for this post are now closed. If you have corrections, suggestions, or other feedback, you can reach me through the contact page.