Book Image

Learning Joomla! 1.5 Extension Development

Book Image

Learning Joomla! 1.5 Extension Development

Overview of this book

Table of Contents (17 chapters)
Learning Joomla! 1.5 Extension Development
Credits
About the Author
About the Reviewer
Preface

Overriding JTable methods


Because the Restaurant Reviews component is now in use and in a stable state, we will leave it alone for the moment. Instead of using the jos_reviews table, we will create a new component with its own table. This component will manage the profiles of the critics and also allow us to try different methods without worrying about the user interface or the data. You can write this component in a completely separate installation of Joomla! if you desire, but it is perfectly safe to write it within the existing one.

Before writing the component, we need to set up the MySQL database table that will hold the critic profiles. If you are using the command line interface for MySQL, this query can be entered to create the database table (assuming your database prefix is jos_):

create table jos_critic (
`id` int(11) auto_increment,
`name` varchar(255),
`favorite_food` varchar(255),
`bio` text,
`checked_out` tinyint(1),
`checked_out_time` datetime,
`editor` varchar(255),
`hits...