Determine the current call type based on get params as they can change the output behavior to make the ngrest crud list view.

@return boolean|string
11720
public function getNgRestCallType()
    {
        if ($this->_ngrestCallType === null) {
            $this->_ngrestCallType = (!Yii::$app instanceof \yii\web\Application) ? false : Yii::$app->request->get('ngrestCallType', false);
        }

        return $this->_ngrestCallType;
    }
221484
private function typeMap()
    {
        $request = Request::createFromGlobals();
        $pathInfo = $request->getPathInfo();
        $pathInfo = trim($pathInfo, '/');
        $routeConfigure = $this->getRule();
        foreach ($routeConfigure as $key => $value) {
            if ($pathInfo == trim($key, '/')) {
                return $this->render($value);
            }
        }
        return $this->render('');
    }
559739
public function getResultingType() : \Dms\Core\Persistence\Db\Schema\Type\Type
    {
        if (in_array($this->operator, [self::ADD, self::SUBTRACT])) {
            return $this->left->getResultingType();
        } else {
            return new Boolean();
        }
    }
426504
private function getRestNode()
    {
        $node = $this->createRootNode('rest');
        return $node
            ->addDefaultsIfNotSet()
            ->children()
                ->scalarNode('root_endpoint')->isRequired()->cannotBeEmpty()->defaultValue('modlr/api')
                    ->validate()
                        ->always(function($v) {
                            $v = $this->formatRestEndpoint($v);
                            return $v;
                        })
                    ->end()
                ->end()
                ->booleanNode('debug')->defaultValue(false)->end()
            ->end()

        ;
    }
409964
public function getPostType()
    {
        $called_class_segments = explode('\\', get_called_class());
        $class_name = end($called_class_segments);
        return (is_null($this->post_type))
            ? Str::machine(Str::camelToHuman($class_name), Base::SEPARATOR)
            : $this->post_type;
    }
687161
public function getType() {
    if (isset($this->result['error'])) {
      $message = $this->result['error'];
      if (is_string($message)) {
        // OAuth 2.0 Draft 10 style
        return $message;
      }
    }
    return 'Exception';
  }
34688
public function current() {

        if (!$this->recordset->valid()) {
            return false;
        }

        if (!$record = $this->recordset->current()) {
            return false;
        }

        // Apply callback and return.
        if (!is_null($this->callbackextra)) {
            return call_user_func($this->callback, $record, $this->callbackextra);
        } else {
            return call_user_func($this->callback, $record);
        }
    }
1370307
function get_module_type() {
            if ( ! isset( $this->_module_type ) ) {
                $id_slug_type_path_map = self::$_accounts->get_option( 'id_slug_type_path_map', array() );
                $this->_module_type    = $id_slug_type_path_map[ $this->_module_id ]['type'];
            }

            return $this->_module_type;
        }
1127603
public function getCallbackResult()
    {
        $class = $this->requestBag->getClassData()['class'];
        if (is_string($class)) {
            $this->requestBag->setClassInstance(new $class);
        } else {
            $this->requestBag->setClassInstance($class);
        }

        // create CallbackResult instance
        $cr = new CallbackResult();

        $env = 'production';
        if ($this->requestBag->getApiConfig()->get('Environment', 'production') == 'development') {
            $cr->setEnvToDevelopment();
            $env = 'development';
        }

        // attach some metadata
        $cr->attachDebugHeader('Class', $class);
        $cr->attachDebugHeader('ClassVersion', $this->requestBag->getClassData()['version']);
        $cr->attachDebugHeader('Method', strtoupper($this->httpRequest()->getRequestMethod()));


        if (!$this->requestBag->getMethodData()) {
            // if no method matched the request
            $cr->setHeaderResponse(404);
            $cr->setErrorResponse('No service matched the request.');

            return $cr;
        }

        // check rate limit
        try {
            $rateControl = RateControl::isWithinRateLimits($this->requestBag, $cr);
            if (!$rateControl) {
                $cr->setHeaderResponse(429);
                $cr->setErrorResponse('Rate control limit reached.');

                return $cr;
            }
        } catch (\Exception $e) {
            throw new RestException('Rate control verification failed. ' . $e->getMessage());
        }

        // verify access role
        try {
            $hasAccess = Security::hasAccess($this->requestBag);
            if (!$hasAccess) {
                $cr->setHeaderResponse(403);
                $cr->setErrorResponse('You don\'t have the required access level.');
                $cr->attachDebugHeader('RequestedRole', $this->requestBag->getMethodData()['role']);

                return $cr;
            }
        } catch (\Exception $e) {
            throw new RestException('Access role verification failed. ' . $e->getMessage());
        }

        // verify cache
        try {
            $cachedResult = Cache::getFromCache($this->requestBag);
        } catch (\Exception $e) {
            throw new RestException('Reading result from cache failed. ' . $e->getMessage());
        }

        // finalize output
        if ($cachedResult) {
            $cr->setData($cachedResult);
            $cr->attachDebugHeader('Cache', 'HIT');
        } else {
            try {
                // Check if we have a Middleware set up
                $middleware = $this->requestBag->getApiConfig()->get('Middleware');
                if ($middleware) {
                    $middleware = new $middleware;
                    if (!$this->isInstanceOf($middleware, MiddlewareInterface::class)) {
                        throw new RestException('Your custom Rest middleware must implement `' . MiddlewareInterface::class . '`');
                    }
                    $this->middleware = $middleware;
                }

                if ($this->middleware) {
                    $result = $this->middleware->getResult($this->requestBag);
                } else {
                    $result = call_user_func_array([
                        $this->requestBag->getClassInstance(),
                        $this->requestBag->getMethodData()['method']
                    ], $this->requestBag->getMethodParameters());
                }

                // check if method has custom headers set
                $cr->setHeaderResponse($this->requestBag->getMethodData()['header']['status']['success']);
                $cr->attachDebugHeader('Cache', 'MISS');

                // add result to output
                $cr->setData($result);

                // check if we need to attach the cache headers
                if ($this->requestBag->getMethodData()['header']['cache']['expires'] > 0) {
                    $cr->setExpiresIn($this->requestBag->getMethodData()['header']['cache']['expires']);
                }

                // cache the result
                Cache::saveResult($this->requestBag, $result);

            } catch (RestErrorException $re) {
                // check if method has custom headers set
                $cr->setHeaderResponse($statusCode = $re->getResponseCode(),
                    $this->requestBag->getMethodData()['header']['status']['errorMessage']);

                // check if a custom http response code is set


                $cr->setErrorResponse($re->getErrorMessage(), $re->getErrorDescription(), $re->getErrorCode());
                $errors = $re->getErrors();
                foreach ($errors as $e) {
                    $cr->addErrorMessage($e);
                }

                if ($env == 'development') {
                    $cr->addDebugMessage([
                        'file'   => $re->getFile(),
                        'line'   => $re->getLine(),
                        'traces' => explode('#', $re->getTraceAsString())
                    ]);
                }
            } catch (\Exception $e) {
                // check if method has custom headers set
                $cr->setHeaderResponse($this->requestBag->getMethodData()['header']['status']['error'],
                    $this->requestBag->getMethodData()['header']['status']['errorMessage']);

                $cr->setErrorResponse('There has been an error processing the request.');
                if ($env == 'development') {
                    $cr->addErrorMessage(['message' => $e->getMessage()]);
                    $cr->addDebugMessage([
                        'file'   => $e->getFile(),
                        'line'   => $e->getLine(),
                        'traces' => explode('#', $e->getTraceAsString())
                    ]);
                }
            }
        }

        return $cr;
    }
1298803
public function getSortType()
    {
        $sortType = isset($this->requestParams[self::PARAM_SORT_TYPE]) ?
            $this->requestParams[self::PARAM_SORT_TYPE] : self::DEFAULT_SORT_TYPE;
        $sortType= mb_strtolower($sortType);

        if(!in_array($sortType, ['string', 'numeric'])) {
            $sortType = self::DEFAULT_SORT_TYPE;
        }

        return $sortType;
    }
1054367
protected function getRestMethod()
    {
        $request = $this->getRequest();

        if (Request::getHttpMethodParameterOverride() || !$request->request->has('_method')) {
            return $request->getMethod();
        }

        return $request->request->get('_method');
    }
1126959
public static function getCaller()
    {
        $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3);
        if (isset($backtrace[2])) {
            $caller = '';
            if (isset($backtrace[2]['class'])) {
                $caller = $backtrace[2]['class'] . $backtrace[2]['type'];
            }
            $caller .= $backtrace[2]['function'];
            return $caller;
        }
        return '{null}';
    }
741799
public static function get_method() {
	if (empty($_SERVER['REQUEST_METHOD'])) {
		return 'GET';
	}
	
	$allowed_methods = ['GET', 'PUT', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'HEAD'];
	if (in_array($_SERVER['REQUEST_METHOD'], $allowed_methods) == false) {
		return false;
	}
	
	return $_SERVER['REQUEST_METHOD'];
}
1173032
public function getTypeDoctrine()
    {
        if (isset(self::$doctrineTypeMap[$this->getType()])) {
            return self::$doctrineTypeMap[$this->getType()];
        }

        // our fallback default
        return self::$doctrineTypeMap[self::TYPE_STRING];
    }
103126
protected function determineMethod(): string
	{
		$this->realMethod = $method = strtoupper($this->server->get('REQUEST_METHOD', 'GET'));

		if($method === 'POST')
		{
			return strtoupper($this->post->get('REQUEST_METHOD_OVERRIDE', $this->server->get('HTTP_X_HTTP_METHOD_OVERRIDE', 'POST')));
		}

		return $method;
	}
569900
public function method()
    {
        // Return the emulated method from GET
        $emulated = filter_input(INPUT_GET, '_method', FILTER_SANITIZE_STRING);

        // Return the emulated method from POST
        if (!$emulated) {
            $emulated = filter_input(INPUT_POST, '_method', FILTER_SANITIZE_STRING);
        }

        // Set the emulated method
        if ($this->app->config('request.emulate') && $emulated) {
            return $emulated;
        }

        // Or the real method
        return $_SERVER['REQUEST_METHOD'];
    }
409901
public static function get_post_types() {
		$param     = array(
			'_builtin' => false,
			'public'   => true,
		);
		$post_type = get_post_types( $param );

		return array_filter( $post_type, array( __CLASS__, 'is_rewrite_supported_by' ) );

	}