Working with the database and models in ZOO/JBZoo

In this case we’ll only talk about those that work with the database of a component.

It should be noted that the things we’ll examine can hardly be called models. But still they perform their functions - abstracting from the database.

It is recommended to use these entities to work with the database. This way it will not break the integrity of the data in the system and various events can be used. We write this for those who like to work with the database using clean SQL-queries.

Fetching the data from the database

Standard things can be done using table helper.

Partially we talked about this in the article about ZOO (JBZoo) component API. Now let’s examine more complex examples.

Correctly deleting from the database

An item has a lot of dependences in the database (comments, an index, categories, applications, tags etc.). These relations extend almost to all ZOO tables.

In order to correctly delete an item (or some other entity) only ZOO methods should be called. Otherwise you’ll have various junk in the database and as a result - hidden database errors and excess size.

Still gotta questions, who can help me?

Visit our special JBZoo tech support forum which is specifically meant for JBZoo so the priority of the response and its promptness are much better there than in any other place. With inactive account with a “Plus” sign in a tariff plan you can ask for support in one of these sections or use any of our contacts.

The Joomla! name is used under a limited license from Open Source Matters in the United States and other countries.
JBZoo is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.