Pages::addWhereClause($clause[,$variables])
Version 2025.4
Add new where clause to query
Version 2025.4
Add new where clause to query
$this
Get all projects that are open:
$Projects = $this->get('pages','project')->addWhereClause("project.status='open'");
Execute values: Get all projects that have 'elementti' in name:
$Projects = $this->get('pages','project')
->addWhereClause("project.name LIKE concat('%',?,'%') ", Array('elementti') );
Execute variables: Get all projects that have 'elementti' in name:
$Projects = $this->get('pages','project')
->addWhereClause("project.name LIKE concat('%',:name,'%') ", Array(
'name' => 'elementti'
));
Search from join data: Adds automatickly joins to data that is used in clause:
$Projects = $this->get('pages','project')
->addWhereClause("client.name LIKE concat('%',:name,'%') ", Array(
'name' => 'customer'
));