Relational Model Documentation
$followers = $this
Active Record (ORM) with support for Conditions, Expressions, Sub-Queries, References and Joins. Based on "Model" and "DSQL".
Goals and Features of Model
Models will manage your SQL Query for you, consistently and reliably.
When traversing references, conditions are automatically set eliminating the possibility for developer's mistake.
Sometimes your business entity consists of 2, 3 or even more tables joined together. Relational Models support automatic table joins when you are retrieving data or inserts into related table and linking ID fields if you are addin records.
Models do eliminate need for the SQL but they still give the power of specifying expressions.
Because Model_Table inherits regular Model, you can still use it with any Data Controllers such as caches.
Whenever you need to create a custom SQL query, you can clone it off "base" query used by the model. That will automatically apply conditions and joins.
Relational Models distinguish events for performing Insert and Modification. You can set hooks to intercept and modify query before it is executed.
Through the power of DSQL Models support multiple database vendors and will automatically use proper SQL syntax.
What DSQL is not?
In the spirit of Agile Toolkit — all of it's classes are strictly focused on a one simple task, without trying to do everything. Here are things which Model will not do and why:
That is job of your database migration scripts.
Relational Model does not take the power of custom SQL queries.