Get Beans with 1 Query

From RedBean

Jump to: navigation, search

Fetching beans with SQL

You have seen already that fetching beans is easy. Just fetch some keys using $adapter->get() and then use batch() to load the beans. If you want to do this all in one query to gain performance you could use either the

Finder::where() 

or:

$rows = $adapter->get("select * from wine");
$wines = $redbean->convertToBeans("Wine", $rows);
Personal tools