GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing redbeanphp.com — RedBeanPHP :: Extended SQL
Extended SQLAs of RedBeanPHP 5.5 you can use some SQL extensions besides @joined, and you can use those extensions with almost any RedBeanPHP function that accepts an SQL snippet. @joinedUse @joined to access parent beans directly in SQL: @ownUse @own to access own-lists in SQL: @sharedUse @shared to access shared-lists in SQL: ChainingSQL-extensions also work with CTEs (trees) and you can chain them. In the tree-query above we use multiple SQL-extensions together and we also chain them, @joined.author.shared.role.label will access the author parent beans and then check the label associated with its shared role. You can make it as complex as you wish. Under the hood, RedBeanPHP translates these @-lists to JOINS. Aliasing in SQL-extensionsUse aliases in SQL-extensions as follows: This will find any book written by Bob, checking the name using the author-property of the bean instead of the person property. You can also use aliases for own-lists: Separate multiple aliases with a slash: Note that the word in front of the colon (as:) is only there for yourself as a reminder, RedBeanPHP figures out how to use the alias depending on the type of list you access. Of course you can chain aliased items as well: Vias in ExtensionsTo treat an intermediate bean type or two complimentary N-1 relations as as a N-M relation in SQL, you can use the via-operator as well: These features can also be used in $books = $author->withCondition( SQL ) - context. back to main menu
Donate to RedBeanPHP using Monero: RedBeanPHP Easy ORM for PHP © 2026 Gabor de Mooij
() and the RedBeanPHP community
(credits) - Licensed New BSD/GPLv2 -
RedBeanPHP Archives
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |