Introducing The Model Class
Trongate comes with a fully featured PHP class for assisting with database interaction. The class is called 'Model' and is stored in a file named Model.php inside the engine directory.
Throughout this documentation, a blue circle with an 'i' symbol often appears on the right hand side of method/function names. Clicking on these icons provides comprehensive details about the function/method's purpose, signature, expected arguments, return types, and practical use case examples.
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()