Hello,
Consider something like this:
$query=$this->modelsManager->createBuilder()
->from('Articles')
->innerJoin('Categoryarticles','Articles.id=Categoryarticles.articleid')
->innerJoin('Categories','Categoryarticles.categoryid=Categories.id')
->where('Articles.languagekey=:languagekey:')
->where('Categories.languagekey=:languagekey:')
->andWhere('Categories.id>:id:',array('id' => $id));
$totals=$query
->columns(array('COUNT(DISTINCT Articles.id) AS totals'))
->getQuery()
->setUniqueRow(true)
->execute(array('languagekey' => $this->languagekey(), 'id' => $id);
In here I use parameter languagekey twice, adding it in execute I have to bound a value only one time. It's for me much easier than passing the same parameter & value agan and again in the query construction
Now I use a Paginator using the QueryBuilder, something like
$paginator=new QueryBuilder(
array(
"builder" => $builder,
"limit" => 10,
"page" => $page
)
);
My question: How can I passing parameters in query execution in QueryBuilder?