The Trongate PHP Framework
Documentation
Introduction
Quick Start
Basic Concepts
Understanding Routing
Controllers
Views
Assets
Modules Calling Modules
Parent & Child Modules
Database Operations
Modules within Modules
Templates & Themes
Helpers Explained
Form Handling
Working with Files
The Module Import Wizard
Authorization & Authentication
The API Explorer
Best Practices

Help Improve Our Docs

If you’ve found an error, spotted something missing, or feel a section could be clearer or better explained, we’d love to hear from you. Your feedback helps keep the documentation accurate and useful for everyone.

Please report issues or suggest improvements on GitHub. Community input is invaluable in making the docs stronger.

Not comfortable with GitHub? No problem — you can also get in touch with us directly via our contact form. We welcome all feedback.

Introducing The Model Class

Trongate comes with a fully featured PHP class for assisting with database interaction. The class is named 'Model' and is stored in a file named Model.php, inside the engine directory.

The Model class contains the following methods:

For Data Retrieval:

  • get()
  • get_where()
  • get_where_custom()
  • get_one_where()
  • get_many_where()
  • get_where_in()
  • get_max()

For Data Manipulation:

  • insert()
  • update()
  • update_where()
  • delete()
  • insert_batch()

For Data Analysis and Management:

  • count()
  • count_where()
  • count_rows()
  • describe_table()
  • table_exists()
  • get_all_tables()
  • resequence_ids()

For Custom Database Querying:

  • query()
  • query_bind()

The following pages will provide information on how to perform database operations using Trongate's Model class.

×