- General
- Articles
- Legacy
- Misc
- Third Party
- Who uses RedBeanPHP
- Personal
Views
RedBeanPHP allows you to generate views as you go. For instance imagine we have a village that contains buildings and each building has some furniture (nested beans). We have the beans: village,building,furniture. To query these tables to calculate how many pieces of furniture there are in each home would require a rather lengthy query. Luckily RedBeanPHP can generate an easy to use view for us:
R::view('furniturestats','village,building,furniture');
Now simply run your query on table furniturestats.
To re-join a previously added type once again, simply repeat the name of the type.
Views do not recognize aliases.
You need a database that supports views (i.e. SQLite 2.4+).
Tweet
User contributed notes. Please use the comment section to provide tips, notes and examples. To ask for support or to provide feedback use the forum. For bug reports use Github Issue Tracker.
Site comments powered by Disqus