It makes no sense to load only some fields from the record:
- By choosing fewer fields, you will not reduce the number of queries
- This will not reduce the amount of data that needs to be transferred (this is more related to the number of rows)
In addition, RedBeanPHP already lazy loads all relational fields, so there is no need for this guide. If you are only interested in using one cell:
R::getCell("select title from document where id = 1");
Or just grab some fields from a record:
R::getRow("select id,title from document where... ");
These functions return records, not beans; this is the fastest way to handle simple fields and strings.
Hope this answer helps ...
source share