Answer the question
In order to leave comments, you need to log in
How to sample a model with relationships in PhalconPHP?
There is already a fairly large project in PhalconPHP. In general, it suits me a little more than completely, but models have 1 fatal flaw: there is no with () method or anything like that that could select a model along with relationships.
This problem is very acute, because there are some models on the project that almost always use data from relationships when generating a page. You can cache, but a simple LEFT JOIN by index would cost less memory than caching .
The framework itself is now undergoing a census to version 2, which I will gladly switch to, but the point here is somewhat different: now there is no such function.
Hence the question: how can one extend the basic PhalconPHP model to teach it how to query with relationships? If nothing can be done at all, then share Standalone ORM to work with the database.
PS please don't write about the fact that I chose the wrong tool - the tool is good, the only question is with this relationship.
Answer the question
In order to leave comments, you need to log in
You don't read the documentation well...
There are relations there, look here in the documentation.
Relationships in Phalcon are read from the database every time they are accessed, in
order to avoid this behavior, when declaring relations in parameters, specify:
...,
'reusable' => true,
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question