DB::DBAL

The World's Most Powerful Light-Weight DBAL

Models

Models are basically optional table classes that allow you to define specific actions that should be taken anytime a specified action is made against the table.

For example, with the init() method, you can determine a certain set of actions to be taken everytime an action is taken against the table.  Or with setup() you can specify specific properties you wish to use in other methods, or use table specific functions such as setPrimaryKey() to define a primary key for this table.  preSave() allows you to perform any actions or formatting before data is inserted or updated!  More Model Methods can be found below.

Best of all, table Models are 100% optional.  If you take the time to create them, awesome!  You will have the power of universal, reusable code (such as validation, formatting, etc).  If not, that’s fine too, DB::DBAL will simply ignore any non-existing files or methods within the table Models.

Model Methods

  • Init
  • Setup
  • PreFetch
  • PostFetch
  • PreInsert
  • PostInsert
  • PreUpdate
  • PostUpdate
  • PreSave
  • PostSave