Validate the existence of the controller's corresponding model
or determine the model based on the controller's name.

@throws APIControllerException
184296
protected function validateModel()
    {
        if (!is_string($this->model)) {
            $baseName = $this->getControllerBaseName();
            $this->findModelClass($baseName);
        }
    }
1097279
public function validateModelClass()
    {
        if ($this->isReservedKeyword($this->modelClass)) {
            $this->addError('modelClass', 'Class name cannot be a reserved PHP keyword.');
        }
        if (substr($this->tableName, -1) !== '*' && $this->modelClass == '') {
            $this->addError('modelClass', 'Model Class cannot be blank if table name does not end with asterisk.');
        }
    }
1208012
function () {
    this.controllerPresent = false;
    this.isControllerPresent = trackedControlsUtils.isControllerPresent; // to allow mock
    this.buttonStates = {};
    this.previousAxis = [];
    this.onModelLoaded = bind(this.onModelLoaded, this);
    this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);
    this.onGamepadConnected = bind(this.onGamepadConnected, this);
    this.onGamepadDisconnected = bind(this.onGamepadDisconnected, this);
  }
1130222
private void injectController(AppController controller) {
        Injector injector = Configuration.getInjector();
        if (injector != null) {
            injector.injectMembers(controller);
        }
    }
953826
public function getController()
    {
        if ($this->controller) {
            return $this->controller;
        }
        foreach (array_reverse(ClassInfo::ancestry($this->class)) as $blockClass) {
            $controllerClass = "{$blockClass}Controller";
            if (class_exists($controllerClass)) {
                break;
            }
        }
        if (!class_exists($controllerClass)) {
            throw new ValidationException("Could not find controller class for $this->classname");
        }

        $this->controller = Injector::inst()->create($controllerClass, $this);
        $this->controller->init();

        return $this->controller;
    }
100642
protected function initializeActionMethodValidators()
    {
        $this->initializeActionMethodValidatorsParent();

        $request = $this->getRequest();

        if (false === $request->hasArgument('name')) {
            throw MissingArgumentException::ajaxControllerNameArgumentNotSet();
        }

        if (false === $request->hasArgument('className')) {
            throw MissingArgumentException::ajaxControllerClassNameArgumentNotSet();
        }

        $className = $request->getArgument('className');

        if (false === class_exists($className)) {
            throw ClassNotFoundException::ajaxControllerFormClassNameNotFound($className);
        }

        if (false === in_array(FormInterface::class, class_implements($className))) {
            throw InvalidArgumentTypeException::ajaxControllerWrongFormType($className);
        }

        $this->arguments->addNewArgument($request->getArgument('name'), $className, true);
    }
789728
public function hasCustomController()
    {
        $controllerName = ucfirst(str_replace('post_', '', $this->slug));
        if(File::exists(Theme::getPath().'/controllers/'.$controllerName.'Controller.php')) {
            return true;
        }
        return false;
    }
131895
function () {
    var data = this.data;
    var controller = controllerUtils.findMatchingControllerWebVR(
      this.system.controllers,
      data.id,
      data.idPrefix,
      data.hand,
      data.controller
    );

    this.controller = controller;
    // Legacy handle to the controller for old components.
    this.el.components['tracked-controls'].controller = controller;

    if (this.data.autoHide) { this.el.object3D.visible = !!this.controller; }
  }
660659
protected function _isControllerSerializeTrue() {
		if (!empty($this->Controller->viewVars['_serialize']) && $this->Controller->viewVars['_serialize'] === true) {
			return true;
		}
		return false;
	}
1176059
def name(self, value):
        """"""
        data = {
            '_set_controller_name': 'Set Name',
            'controller_name': value,
        }
        self.post(data, url=SETUP_ENDPOINT, referer=SETUP_ENDPOINT)
773286
public static function validateControllerClassBasename($controllerClassBasename)
    {
        $controllerClassBasename = str_replace('/', '\\', $controllerClassBasename);

        if (false !== strpos($controllerClassBasename, ':')) {
            throw new \InvalidArgumentException(sprintf(
                'The controller class name must not contain a ":" (colon sign) ("%s" given, '
                .'expecting something like PostAdminController")',
                $controllerClassBasename
            ));
        }

        if ('Controller' !== substr($controllerClassBasename, -10)) {
            throw new \InvalidArgumentException('The controller class name must end with "Controller".');
        }

        return $controllerClassBasename;
    }
1265127
public function addCurrentController(): void
    {
        $controllerName = Inflector::camelize($this->_frontendData['request']['controller']);
        $this->addController(
            $controllerName . '.' . Inflector::camelize($this->_frontendData['request']['action'])
        );
        $this->addController($controllerName);
    }
387147
private static boolean methodExists(String controllerMethod, Class<?> controllerClass) {
        Objects.requireNonNull(controllerMethod, Required.CONTROLLER_METHOD.toString());
        Objects.requireNonNull(controllerClass, Required.CONTROLLER_CLASS.toString());
        
        return Arrays.stream(controllerClass.getMethods()).anyMatch(method -> method.getName().equals(controllerMethod));
    }
821994
public function validate() {

		if ($this->getLineItemUniqueId() === null) {
			throw new ValidationException("'lineItemUniqueId' can't be null", 'lineItemUniqueId', $this);
		}
		if ($this->getQuantityReduction() === null) {
			throw new ValidationException("'quantityReduction' can't be null", 'quantityReduction', $this);
		}
		if ($this->getUnitPriceReduction() === null) {
			throw new ValidationException("'unitPriceReduction' can't be null", 'unitPriceReduction', $this);
		}
	}
1327657
public static function findControllerID()
    {
        if (empty($_REQUEST[self::KEY_ID])
            || empty($_SESSION[sprintf(self::KEY_CONTAINER, $_REQUEST[self::KEY_ID])])
        ) {
            return null;
        } else {
            return $_REQUEST[self::KEY_ID];
        }
    }
456021
private function determineControllerAndAction(&$controller, &$actionName)
    {
        $request = $this->getRequest();
        $this->invokePluginsHook(
            'beforeControllerSelected',
            array($this, $request)
        );

        $controllerDiKey = $request->getController();
        try {
            $controller = $this->getServiceProvider()->getServiceInstance($controllerDiKey);
        } catch (Exception $e) {
            throw new ResourceNotFoundException(sprintf(
                'No such controller found "%s".',
                $this->getRequest()->getController()
            ));
        }
        $actionName = $request->getAction();
        if (!method_exists($controller, $actionName)) {
            throw new ResourceNotFoundException(sprintf(
                '%s does not have method %s',
                $controllerDiKey,
                $actionName
            ));
        }
        $this->invokePluginsHook(
            'afterControllerSelected',
            array($this, $request, $controller, $actionName)
        );
        $controller->initialize($request, $this);
    }
172480
public function checkNavigator()
    {
        // can we find th' darned controller?
        if (!$this->checkControllerExists()) {
            $this->setNotFound();
            return;
        }

        // merge the feckin params
        if (array_key_exists('params', $this->config) && is_array($this->config['params']) ) {
            $merged = array_merge($this->config['params'], $this->request->getQueryParams());
            $this->request = $this->request->withQueryParams($merged);
        }

        // create the controller
        $this->controller = new $this->config['controller_name']($this->request);
        $this->controller->setServerEnvironment($this->getEnv());

        // where's the bloody action?
        if (!$this->checkActionExists()) {
            $this->setNotFound();
        }
        return null;
    }