...
 
Commits (1)
......@@ -66,6 +66,7 @@ class ProcessRockFinder extends Process {
$f->setData($finder);
}
else {
// populate sql property of finder
$f->sql = $code;
}
$form->add($f);
......
<?php
$info = [
'title' => 'RockFinder',
'version' => '1.0.4',
'version' => '1.0.5',
'summary' => 'Highly Efficient and Flexible SQL Finder Module to return page data without loading PW pages into memory',
'singular' => true,
'autoload' => false,
......
......@@ -66,6 +66,11 @@ class RockFinder extends WireData implements Module {
switch(true) {
case $type instanceof FieldtypeRepeater: $type = 'repeater'; break;
case $type instanceof FieldtypeFile: $type = 'file'; break;
// for options fields we use the "file" type
// if multiple options are set this will return all options as string
case $type instanceof FieldtypeOptions: $type = 'file'; break;
case $type instanceof FieldtypePage: $type = 'page'; break;
default: $type = 'text'; break;
}
......
......@@ -73,6 +73,8 @@ d($finder->getObjects());
Notice that this query takes only 239ms and uses 0.19MB of memory while it queries and aggregates more than 10.000 pages!
You can also add custom SQL queries like this: https://processwire.com/talk/topic/19226-rockfinder-highly-efficient-and-flexible-sql-finder-module/?do=findComment&comment=167804 to easily do "reverse queries", for example show all projects that have the current page selected in a page-reference-field.
## Closures
......