Utility Methods

By overriding all the query methods of the SQLiteDatabase class we ensure that any failed query throws an exception. This done, we needn't worry about error trapping whenever we perform a query. The remaining methods of our derived class are utility methods aimed at helping verify data posted from a form. These methods give us an opportunity to explore some of the ways to retrieve metadata from an SQLite database. Find those methods in Listing 15-8.

Listing 15-8. Metadata methods
 /** Get all table names in database */ public function getTableNames(){ if (!isset($this->tablenames)){ $this->setTablenames(); } return $this->tablenames; } ///////////////////////////////////////////////////////////// /** Retrieve field names/types ...

Get Object-Oriented PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.