Filters by type of collection (using the handle field).

@param mixed $ptHandle
776881
public function filterByPageTypeHandle($ptHandle)
    {
        $db = Loader::db();
        $this->filterByPageType = true;
        if (is_array($ptHandle)) {
            $cth = '(';
            for ($i = 0; $i < count($ptHandle); ++$i) {
                if ($i > 0) {
                    $cth .= ',';
                }
                $cth .= $db->quote($ptHandle[$i]);
            }
            $cth .= ')';
            $this->filter(false, "(pt.ptHandle in {$cth})");
        } else {
            $this->filter('pt.ptHandle', $ptHandle);
        }
    }
1318903
public function filter(&$text, TemplateInterface $template)
    {
        $this->_addMetatag($text);
        $this->_addAction($text, $template);
        $this->_addToken($text);
        $this->_addQueryParameters($text);
    }
733308
async def handle(self, record):
        
        if (not self.disabled) and self.filter(record):
            await self.callHandlers(record)
1186551
public function filterRecords()
    {
        if ($this->autoFilter && $this->request->isSearchable()) {
            $this->filtering();
        } else {
            if (is_callable($this->filterCallback)) {
                call_user_func($this->filterCallback, $this->filterCallbackParameters);
            }
        }


        $this->columnSearch();
        $this->filteredRecords = $this->isFilterApplied ? $this->count() : $this->totalRecords;
    }
790859
private function findOrNewRecord(array $recordsByHandle, array $definition, string $handle): Model
    {
        $record = new $definition['class']();
        if (array_key_exists($handle, $recordsByHandle)) {
            $existing = $recordsByHandle[$handle];
            if (get_class($record) == get_class($existing)) {
                $record = $existing;
            } else {
                $record->id = $existing->id;
                $record->setAttributes($existing->getAttributes());
            }
        }

        return $record;
    }
1075442
public function handleData(QueryHandlerInterface $queryHandler, FilterInterface $filter, $data): void
    {
        if (!$queryHandler instanceof EAVQueryHandlerInterface) {
            throw new BadQueryHandlerException($queryHandler, EAVQueryHandlerInterface::class);
        }
        if (!$queryHandler->isEAVFilter($filter)) {
            $this->fallbackFilterType->handleData($queryHandler, $filter, $data);

            return;
        }
        if ($this->isEmpty($data)) {
            return;
        }

        $eavQb = new EAVQueryBuilder($queryHandler->getQueryBuilder(), $queryHandler->getAlias());
        $eavQb->setContext($queryHandler->getQueryContext());
        $dqlHandlers = [];
        foreach ($filter->getAttributes() as $attributePath) {
            $attributeQb = $queryHandler->getEAVAttributeQueryBuilder($eavQb, $attributePath);
            $dqlHandlers[] = $this->applyAttributeQueryBuilder($attributeQb, $data);
        }

        if (0 < \count($dqlHandlers)) {
            $eavQb->apply($eavQb->getOr($dqlHandlers));
        }
    }
1035359
public function filter($filterer, $op = '===')
    {
        $collection = new Collection($this->store);
        return $collection->filter($filterer, $op);
    }
626983
private function getFolderByHandle(string $folderHandle): \stdClass
    {
        $volume = Craft::$app->volumes->getVolumeByHandle($folderHandle);
        if ($volume) {
            $folder = $this->getFolderByVolumeId($volume->id);
            if ($folder) {
                return  (object) [
                    'id' => $folder->id,
                    'handle' => $folderHandle
                ];
            }
        }
        return null;
    }
705992
public static function getByHandle($pThemeHandle)
    {
        $where = 'pThemeHandle = ?';
        $args = [$pThemeHandle];
        $pt = static::populateThemeQuery($where, $args);

        return $pt;
    }
1107930
public function getTokensByProvider($providerHandle)
    {
        $conditions = 'providerHandle=:providerHandle';
        $params = array(':providerHandle' => $providerHandle);
        $records = Oauth_TokenRecord::model()->findAll($conditions, $params);
        return Oauth_TokenModel::populateModels($records);
    }
616412
public function filter(callable $c = null)
    {
        if ($c === null) {
            $c = function ($v) {
                return (bool)$v;
            };
        }

        return new FilterIterator($this->unwrap(), $c);
    }
906161
public function ProcessCustomHandlers (& $handlers = []) {
		if (!$handlers || $this->request->IsInternalRequest() === TRUE) return TRUE;
		$result = TRUE;
		foreach ($handlers as $handlerRecord) {
			list ($closureCalling, $handler) = $handlerRecord;
			$subResult = NULL;
			try {
				if ($closureCalling) {
					$subResult = $handler($this->request, $this->response);
				} else {
					$subResult = call_user_func($handler, $this->request, $this->response);
				}
				if ($subResult === FALSE) {
					$result = FALSE;
					break;
				}
			} catch (\Exception $e) {
				$this->DispatchException($e);
				$result = FALSE;
				break;
			}
		}
		return $result;
	}
1114673
public function dropIndex($indexHandle)
    {
        $handle = explode('/', $indexHandle);
        $this->getConnection()->delete(UrlHelper::buildUrl(Urls::URL_INDEX, [$handle[0], $handle[1]]));

        return true;
    }
1162568
public function getByHandle($akCategoryHandle)
    {
        $r = $this->entityManager->getRepository(Category::class);

        return $r->findOneBy(['akCategoryHandle' => $akCategoryHandle]);
    }
981898
public function filter(callable $callback): CollectionInterface
    {
        $collection = clone $this;
        $collection->data = \array_merge([], \array_filter($collection->data, $callback));

        return $collection;
    }
255665
public function handle($handle = null)
    {
        if (!is_null($handle)) {
            $this->handle_attribute = $handle;
        }
        if (isset($this->handle_attribute)) {
            return $this->handle_attribute;
        }

        return $this->handle($this->loadImageHandle());
    }
363704
public function filter(Closure $p)
    {
        $this->guardAgainstInvalidGivenType();
        $elements = $this->collection->filter($p)->toArray();

        return $this->create($elements);
    }