Manual and Documentation

NOTE: This manual describes HammerKit version 3.5. To view documentation for the current release of HammerKit Studio, please go to http://manual.hammerkit.com/
search
Index / D. Object API / Using the API

A. Introduction
B. Installation and Configuration
C. Using HammerKit tools
D. Object API
Classes
Interfaces
Object Choosers
Global Variables
Modules
Tools
Converters
Using the API
E. HammerScript
F. Access Rights
Using the API


This section lists common guidelines for authors of modules, tools and converters. All of these extensions to HammerKit utilize the core of HammerKit which is accessed through HammerKit's Object API. The Object API is completely object oriented and based on the object model of PHP 5. The following is a list of instructions for users of HammerKit's Object API.

  1. Never access the database directly for fetching, updating or adding data related to a HammerKit site. All of these functions are handled by the classes of the Object API. If data in the database for some reason has to be accessed directly do it only through the HammerKit_Db class as this class automatically handles database access abstraction and input validation. The structure of the database might change between HammerKit versions but the Object API is designed to remain unchanged and at least maintain backwards compatibility.

  2. All objects of classes implementing the interface HammerKit_ObjectInterface must be instantiated through the static method getInstance. Instantiation by using the new keyword is not allowed and will cause a fatal error as the constructor method of these classes is private. This model of instantiating objects makes it possible to handle caching of already instantiated objects and prevents and object's data to be fetched more then once from the database.

  3. In the user interface XHTML all elements ids and class names are defined in a global name space. To avoid conflicts with other HammerKit extensions all id and class names must be




� HammerKit Oy 2008 UPDATED: 19.01.2009 12:57