MidgardQueryBuilder method execute
array $qb->execute([array arguments])
execute is the method for executing Query Builder queries. It returns an array of MgdSchema objects matching the query constraints. If no matching objects are found from the database, an empty array will be returned.
Constraints can not be changed , once has been added to Midgard Query Builder. If you need to run similiar SQL query with some different constraints' values, you should create new QB instance or use add_placeholder_constraint method. Exceptions here are set_limit and set_offset methods.
Midgard 1.8: The optional arguments array can be used to specify the values of placeholder constraints specified with the add_placeholder_constraint method.
Usage:
<?php
$qb = new MidgardQueryBuilder("midgard_article");
// List articles in topic #123
$qb->add_constraint('topic', '=', 123);
$articles = $qb->execute();
foreach ($articles as $article)
{
echo "<h2>{$article->title}</h2>/n";
}
?>
