Creates blueprint for filters.

@return Blueprint
422252
protected function makeFilterBlueprint()
    {
        return new Blueprint(self::FILTER_CLASS, [
            new SimpleValueAsField('name'),
            new CustomMapping('type', function ($type, Scaffold $s) {
                switch($type) {
                    case 'select':
                        $s->class = 'Nayjest\Grids\SelectFilterConfig';
                        break;
                    default:
                        break;
                }
            }, null, Instruction::PHASE_PRE_INST),
            new Rename(0,'name'),
            new Rename(1,'operator'),
        ]);
    }
11945
protected function getFilter() {
		$filter = $this->getOption('query.filter');
		$negate = false;
		if ($this->hasOption('query.negate'))
			$negate = (bool) $this->getOption('query.negate');
		if (is_array($filter))
			return new Filter($filter, $negate);
		return new Filter([$filter], $negate);
	}
1148140
protected function makeComponentBlueprint()
    {
        $blueprint = new Blueprint(self::COMPONENT_CLASS, [

            new CustomInstruction(function (Scaffold $s) {
                if ($s->input instanceof Closure) {
                    $s->class = 'Nayjest\Grids\Components\RenderFunc';
                    $s->constructor_arguments = [$s->input];
                    $s->input = [];
                } elseif (is_string($s->input)) {
                    $s->class = 'Nayjest\Grids\Components\RenderFunc';
                    $out = $s->input;
                    $s->constructor_arguments = [function () use ($out) {
                        return $out;
                    }];
                    $s->input = [];
                }
            }, Instruction::PHASE_PRE_INST),
            new CustomMapping('type', function ($type, Scaffold $s) {
                if (strpos($type, '\\') !== false) {
                    $s->class = $type;
                } else {
                    $s->class = 'Nayjest\Grids\Components\\' . str_replace(
                            ' ',
                            '',
                            ucwords(str_replace(array('-', '_'), ' ', $type))
                        );
                }
            }, null, Instruction::PHASE_PRE_INST)
        ]);
        $blueprint->add(new BuildChildren('components', $blueprint));

        $blueprint->add(new Rename('component', 'add_component'));
        $blueprint->add(new Build('add_component', $blueprint));
        $blueprint->add(new CallMethodWith('add_component','addComponent'));

        return $blueprint;
    }
936196
private function buildFilters()
    {
        $filters = array();

        // file only ? or direcotry only ?
        if ($this->file_only) $filters[] = new Filter\FileOnlyFilter();
        if ($this->directory_only) $filters[] = new Filter\DirectoryOnlyFilter();

        // name match ?
        foreach ($this->names as $name) {
            $filters[] = new Filter\NameFilter($name);
        }

        return $filters;
    }
473217
public static function getTypes()
    {
        if (!self::$types) {
            $grav = Grav::instance();

            $scanBlueprintsAndTemplates = function () use ($grav) {
                // Scan blueprints
                $event = new Event();
                $event->types = self::$types;
                $grav->fireEvent('onGetPageBlueprints', $event);

                self::$types->scanBlueprints('theme://blueprints/');

                // Scan templates
                $event = new Event();
                $event->types = self::$types;
                $grav->fireEvent('onGetPageTemplates', $event);

                self::$types->scanTemplates('theme://templates/');
            };

            if ($grav['config']->get('system.cache.enabled')) {
                /** @var Cache $cache */
                $cache = $grav['cache'];

                // Use cached types if possible.
                $types_cache_id = md5('types');
                self::$types = $cache->fetch($types_cache_id);

                if (!self::$types) {
                    self::$types = new Types();
                    $scanBlueprintsAndTemplates();
                    $cache->save($types_cache_id, self::$types);
                }

            } else {
                self::$types = new Types();
                $scanBlueprintsAndTemplates();
            }

            // Register custom paths to the locator.
            $locator = $grav['locator'];
            foreach (self::$types as $type => $paths) {
                foreach ($paths as $k => $path) {
                    if (strpos($path, 'blueprints://') === 0) {
                        unset($paths[$k]);
                    }
                }
                if ($paths) {
                    $locator->addPath('blueprints', "pages/$type.yaml", $paths);
                }
            }
        }

        return self::$types;
    }
399378
public function build()
    {
        $input = new BucketInput($this->namespace, $this->filters);
        $spec  = new Specification($input, $this->phases, $this->timeout);

        return new BucketMapReduce($spec);
    }
368309
public function blueprint(Blueprint $blueprint) {
        foreach($blueprint->getActions() as $action) {
            $this->action($action);
        }
    }
949500
private function getPreFilterInstances()
    {
        $prefilters = $this->getPreFilters();

        foreach($prefilters as $prefilter) {
            if ($prefilter instanceof PHPTAL_PreFilter) {
                $prefilter->setPHPTAL($this);
            }
        }
        return $prefilters;
    }
1259681
public function filter()
    {
        $blueprints = $this->blueprints();
        $values = $blueprints->filter($this->toArray());
        if ($values && isset($values['header'])) {
            $this->header($values['header']);
        }
    }
842990
protected function buildFilter(Filter\AbstractFilter $descriminator = null)
    {
        if ($descriminator === null) {
            return $this->getSearchBaseFilter();
        }

        return new Filter\AndFilter(
            array(
                $this->getSearchBaseFilter(),
                $descriminator
            )
        );
    }
832762
public function makeSchema(): array
    {
        return [
            Filter::SH_MAP       => $this->buildMap($this->entity),
            Filter::SH_VALIDATES => $this->entity->getProperty('validates', true) ?? [],
            Filter::SH_SECURED   => $this->entity->getSecured(),
            Filter::SH_FILLABLE  => $this->entity->getFillable(),
            Filter::SH_MUTATORS  => $this->entity->getMutators(),
        ];
    }
528278
private function prepareFilterForRootCondition()
    {
        $environment   = $this->getEnvironment();
        $rootCondition = $environment->getDataDefinition()->getModelRelationshipDefinition()->getRootCondition();

        $baseConfig = $environment->getBaseConfigRegistry()->getBaseConfig();
        if (!$rootCondition) {
            return $baseConfig;
        }

        $baseFilter = $baseConfig->getFilter();
        $filter     = $rootCondition->getFilterArray();

        if ($baseFilter) {
            $filter = \array_merge($baseFilter, $filter);
        }

        $baseConfig->setFilter($filter);

        return $baseConfig;
    }
628974
private function constructFilters()
    {
        foreach ($this->filters as $filter_name => $filter_options) {
            $this->filterObjects[] = new TableFilter(
                $this->request,
                $filter_name,
                $filter_options
            );
        }
    }
1081505
public function actionBlueprints()
    {
        $configFiles = FileHelper::findFiles(Architect::$configPath, [
            'only' => ['*.json', '*.yaml'],
            'recursive' => false
        ]);

        foreach ($configFiles as &$file) {
            $file = pathinfo($file, PATHINFO_BASENAME);
        }
        unset($file);

        return $this->renderTemplate('architect/blueprints', [
            'files' => $configFiles
        ]);
    }
1085536
protected function createOrLoadObj()
    {
        if ($this->objId()) {
            return $this->loadObj();
        } elseif (!empty($_GET['clone_id'])) {
            return $this->cloneObj();
        } elseif (!empty($_GET['blueprint_id'])) {
            return $this->createObjFromBluePrint();
        } else {
            return $this->createObj();
        }
    }
110280
public function getFilterValidators()
    {
        if ($this->_filters === null) {
            $this->_filters = $this->createFilters();
        }
        return $this->_filters;
    }
617386
protected function build(Blueprint $blueprint) {
        $grammar = new \Sgpatil\Orientdb\Schema\Grammars\OrientdbGrammar();
        $blueprint->build($this->connection, $grammar);
    }