@param string            $handle
@param string|array|null $context

@return bool|FieldModel
974366
public static function getFieldByHandleContext($handle, $context)
    {
        $fields = Craft::$app->fields->getAllFields(null, $context);
        foreach ($fields as $field) {
            if ($field->handle == $handle) {
                return $field;
            }
        }

        return false;
    }
674320
protected function getAssoc($handle)
    {
        $oldSession = session_id();
        session_commit();
        session_id($handle);
        session_start();
        $assoc = null;
        if(!empty($_SESSION['assoc'])) {
            $assoc = $_SESSION['assoc'];
        }
        session_commit();
        if($oldSession) {
            session_id($oldSession);
            session_start();
        }
        return $assoc;
    }
1106782
public function removeCss($handle = null)
    {
        if (is_null($handle)) {
            return $this->styles = [];
        }

        unset($this->styles[$handle]);
    }
1090710
public function getTask($handle)
    {
        if (!isset($this->handles[$handle])) {
            throw new Exception('Unknown handle');
        }

        if (!isset($this->tasks[$this->handles[$handle]])) {
            throw new Exception('No task by that handle');
        }

        return $this->tasks[$this->handles[$handle]];
    }
182218
public function value($handle = null, $default = '')
    {
        if ($handle && ! $this->get($handle)) {
            return $default;
        }

        if ($handle) {
            return $this->get($handle)->value ?: $this->defaultValue($handle);
        }

        return $this->setting->value ?: $this->setting->default;
    }
1212949
protected function _processHandler(Context $c, $handler, &$response): bool
  {
    $processed = $handler !== null && !is_string($handler);
    while(is_callable($handler))
    {
      $handler = $handler($c);
    }

    if($handler instanceof ContextAware)
    {
      $handler->setContext($c);
    }

    if($handler instanceof Handler)
    {
      $c->events()->trigger(PreExecuteEvent::i($c, $handler));
      $response = $handler->handle($c);
      return true;
    }

    if($handler)
    {
      $response = $handler;
    }

    return $processed;
  }
101273
public function handler(string $root, FrameworkHandler $handler = null): FrameworkHandler
    {
        //if we have this handler in memory
        if (isset($this->handlers[$root])) {
            //if a handler was provided
            if ($handler instanceof FrameworkHandler) {
                //we mean to change up the handler
                $this->handlers[$root] = $handler;
            }

            //either way return the handler
            return $this->handlers[$root];
        }

        //otherwise the handler is not in memory
        if (!($handler instanceof FrameworkHandler)) {
            // By default
            //  - Routes are unique per Handler.
            //  - Middleware are unique per Handler.
            //  - Child pre processors aren't triggered.
            //  - Child post processors aren't triggered.
            //  - Child error processors are set by Parent.
            //  - Child protocols are set by Parent.
            //  - Child packages are set by Parent.
            //  - Child requests are set by Parent.
            //  - Child responses are set by Parent.
            //  - Events are still global.
            $handler = FrameworkHandler::i()->setParent($this);
        }

        //remember the handler
        $this->handlers[$root] = $handler;

        //since this is out first time with this,
        //lets have the parent listen to the root and all possible
        $this->all($root . '**', function ($request, $response) use ($root) {
            //we need the original path
            $path = $request->getPath('string');
            //determine the sub route
            $route = substr($path, strlen($root));

            //because substr('/', 1); --> false
            if (!is_string($route) || !strlen($route)) {
                $route = '/';
            }

            //set up the sub rout in request
            $request->setPath($route);

            //we want to lazy load this in because it is
            //possible that the hander could have changed
            $this->handler($root)
                ->setRequest($request)
                ->setResponse($response)
                ->process();

            //bring the path back
            $request->setPath($path);
        });

        return $this->handlers[$root];
    }
1270925
public static function fetchTitleFromHandle($handle)
    {
        return Symphony::Database()->fetchVar('title', 0, sprintf(
            "SELECT `title`
            FROM `tbl_pages`
            WHERE `handle` = '%s'
            LIMIT 1",
            Symphony::Database()->cleanValue($handle)
        ));
    }
1264224
public function findComponentByHandler($handler)
    {
        foreach ($this->page->components as $component) {
            if ($component->methodExists($handler)) {
                return $component;
            }
        }

        foreach ($this->layout->components as $component) {
            if ($component->methodExists($handler)) {
                return $component;
            }
        }

        return null;
    }
31108
public static function getNeoBlockType($handle, $fieldId)
    {
        $neo = Craft::$app->plugins->getPlugin('neo');
        $blockTypes = $neo->blockTypes->getByFieldId($fieldId);
        foreach ($blockTypes as $block) {
            if ($block->handle == $handle) {
                return $block;
            }
        }

        return false;
    }
312311
private function handleToPropertyName(string $handle, array $fieldProperties): string
    {
        foreach ($fieldProperties as $propertyName=>$property) {
            if ($property['handle'] === $handle) {
                return $propertyName;
            }
        }

        return $handle;
    }
673421
private static function getHandler(string $handler = null)
    {
        if (null === $handler) {
            return null;
        }

        if (!\in_array($handler, self::$handlers, true)) {
            throw new DatabaseException(
                sprintf(
                    'Cannot set "%s" as onDelete or onUpdate. Use one of these instead: "%s"',
                    $handler,
                    implode('", "', self::$handlers)
                )
            );
        }

        return $handler;
    }
1196166
public function removeJs($handle = null)
    {
        if (is_null($handle)) {
            return $this->scripts = [];
        }

        if (is_bool($handle)) {
            foreach ($this->scripts as $i => $javaScript) {
                if ($javaScript->isFooter() === $handle) {
                    unset($this->scripts[$i]);
                }
            }

            return;
        }

        unset($this->scripts[$handle]);
    }
1266854
public function readByHandle($handle)
    {
        $service = $this->getService();

        $response      = $service->request('products/handle/' . $handle, 'GET');
        $responseArray = $this->getResponseArray($response);

        if (!$this->isError()) {
            $this->_data = $responseArray['product'];
        } else {
            $this->_data = array();
        }

        return $this;
    }
872694
public static function getMatrixBlockType($handle, $fieldId)
    {
        $blockTypes = Craft::$app->matrix->getBlockTypesByFieldId($fieldId);
        foreach ($blockTypes as $block) {
            if ($block->handle == $handle) {
                return $block;
            }
        }

        return false;
    }
12274
public function getPreconditionByHandle($handle)
    {
        $list = $this->config->get('install.preconditions');
        if (!isset($list[$handle])) {
            throw new Exception(sprintf('Unable to find an install precondition with handle %s', $handle));
        }
        if (!$list[$handle]) {
            throw new Exception(sprintf('The precondition with handle %s is disabled', $handle));
        }
        $className = $list[$handle];
        $instance = $this->getPreconditionByClassName($className);

        return $instance;
    }
821377
public function executeInContext($context, $service, $operation, $argv = array(), $callback = null)
	{
	    $command = new Command(
            $service,
            $operation,
            $argv,
	        $context);

	    return $this->dispatch($command, $callback);
	}