Checks if the required parameter are available.

@param stdClass $params Item object containing the parameter
@param string[] $names List of names of the required parameter
@throws Controller_ExtJS_Exception if a required parameter is missing
501800
protected function _checkParams( stdClass $params, array $names )
	{
		foreach( $names as $name )
		{
			if( !property_exists( $params, $name ) ) {
				throw new Controller_ExtJS_Exception( sprintf( 'Missing parameter "%1$s"', $name ), -1 );
			}
		}
	}
750590
private function preOpMethodParamsCheck($params)
    {
        $this->MathCheck();

        foreach ($params as $key => $value) {
            if ($this->numberCheck($value) === false) {
                $caller = debug_backtrace();
                throw new \Exception('Empty or invalid parameters passed to ' . $caller[count($caller) - 1]['function'] . ' function. Argument list received: ' . var_export($caller[count($caller) - 1]['args'], true));
            }
        }
    }
1216318
protected function checkMultipartParams( $params ) {
		foreach ( $params as $key => $val ) {
			if ( !is_array( $val ) ) {
				throw new Exception( "Parameter '$key' must be an array." );
			}
			if ( !in_array( $key, array_keys( $this->getParams() ) ) ) {
				throw new Exception( "Parameter '$key' is not already set on this request." );
			}
		}
	}
1208944
public static function containsParams(...$params): bool
    {
        $params = array_flip(is_array($params[0]) ? $params[0] : $params);

        foreach (static::getAllParameters() as $name => $value) {
            if (array_key_exists($name, $params)) {
                unset($params[$name]);
            }
        }

        return count($params) == 0;
    }
1242957
public function setParams($params): void
    {
        if (!\is_array($params) && !\is_object($params)) {
            throw new EventException(
                'Event parameters must be an array or object; received `' . \gettype($params) . '`'
            );
        }

        $this->params = $params;
    }
333017
protected function assertParametersAreValid(array $parameters, array $requiredParameters)
    {
        foreach ($requiredParameters as $parameter) {
            if (empty($parameters[$parameter])) {
                throw RequiredParameterMissingException::withParameter($parameter);
            }
        }
    }
484231
static function checkRequiredParameters(array $given, array $required)
    {
        foreach ($required as $key) {
            if (!array_key_exists($key, $given)) {
                throw new MissingRequiredParameterException(
                        "Missing required parameter '$key'"
                );
            }
        }
    }
1240174
protected function validate($params=array()) {
        foreach ($params as $key=>$value) {
            $this->comment_param->$key = $value;
        }
        $validation = plugin_callback($this->plugintype, $this->pluginname, 'comment', 'validate', array($this->comment_param), false);
        if (!$validation) {
            throw new comment_exception('invalidcommentparam');
        }
    }
505119
protected function loadCollector($name, array $params = null) {
		$locator = $this->getCollectorsLocator();
		
		try {
			return $locator->get(ucfirst($name), $params);
		} catch (Exception $exception) {
			$this->pushException($exception);
		}
	}
158017
protected function getParam(string $name)
    {
        if (!array_key_exists($name, $this->_params)) {
            throw new Exception ('Required parameter "' . $name . '" was not set');
        }

        return $this->_params[$name];
    }
1257054
public function searchItems( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site' ) );
		$this->setLocale( $params->site );

		$total = 0;
		$manager = $this->getManager();
		$search = $this->initCriteria( $manager->createSearch(), $params );
		$items = $manager->searchItems( $search, [], $total );

		return array(
			'items' => $this->toArray( $items ),
			'total' => $total,
			'success' => true,
		);
	}
322995
private function checkRequired()
    {
        // Loop through all params
        foreach ($this->params as $param) {
            if (array_key_exists('required', $param) && $param['required'] == true) {
                if (!array_key_exists($param['name'], $this->pinputs)) {
                    throw new \Exception('Parameter "' . $param['name'] . '" is required');
                }
            }
        }

        // Loop through all options
        foreach ($this->options as $key => $option) {
            // if option is required
            if (array_key_exists('required', $option) && $option['required'] == true) {
                // check that it is defined in pinputs
                if ($this->pinputs[$option['short']] == false) {
                    throw new \Exception('Option "' . $option['help'] . '" is required');
                }
            }
        }

    }
551826
public function deleteItems( \stdClass $params )
	{
		$this->checkParams( $params, array( 'site', 'items' ) );
		$this->setLocale( $params->site );

		$idList = [];
		$context = $this->getContext();
		$manager = \Aimeos\MShop\Factory::createManager( $context, 'media' );
		$cntl = \Aimeos\Controller\Common\Media\Factory::createController( $context );

		$search = $manager->createSearch();
		$search->setConditions( $search->compare( '==', 'media.id', (array) $params->items ) );
		$search->setSlice( 0, count( (array) $params->items ) );

		foreach( $manager->searchItems( $search ) as $id => $item )
		{
			$idList[$item->getDomain()][] = $id;
			$cntl->delete( $item );
		}

		$manager->deleteItems( (array) $params->items );


		foreach( $idList as $domain => $domainIds )
		{
			$manager = \Aimeos\MShop\Factory::createManager( $context, $domain . '/lists' );

			$search = $manager->createSearch();
			$expr = array(
				$search->compare( '==', $domain . '.lists.refid', $domainIds ),
				$search->compare( '==', $domain . '.lists.domain', 'media' )
			);
			$search->setConditions( $search->combine( '&&', $expr ) );
			$search->setSortations( array( $search->sort( '+', $domain . '.lists.id' ) ) );

			$start = 0;

			do
			{
				$result = $manager->searchItems( $search );
				$manager->deleteItems( array_keys( $result ) );

				$count = count( $result );
				$start += $count;
				$search->setSlice( $start );
			}
			while( $count >= $search->getSliceSize() );
		}


		$this->clearCache( (array) $params->items );

		return array(
			'success' => true,
		);
	}
57694
protected function validateParams(array $params)
    {
        foreach ($params as $param) {
            if (!$this->hasRequestParameter($param)) {
                throw new common_exception_MissingParameter($param .' is missing from the request.', $this->getRequestURI());
            }

            if (empty($this->getRequestParameter($param))) {
                throw new common_exception_ValidationFailed($param, $param .' cannot be empty');
            }
        }
    }
300941
protected function _processRequest( array $reqparams )
	{
		try
		{
			if( !isset( $reqparams['params'] ) || ( $params = json_decode( $reqparams['params'] ) ) === null ) {
				throw new Controller_ExtJS_Exception( 'Required parameters are missing or not JSON encoded' );
			}

			if( ( $result = $this->_callMethod( $reqparams['method'], $params ) ) !== null ) {
				return json_encode( $result );
			}
		}
		catch( Exception $e )
		{
			$response = array(
				'error' => array(
					'code' => ( $e->getCode() != 0 ? $e->getCode() : -1 ),
					'message' => $e->getMessage(),
				),
				'status' => 'failure'
			);

			return json_encode( $response );
		}

		return null;
	}
1042058
protected function prepareDataProvider($params = []) {
        if (!isset($params['q'])) {
            throw new Exception('Require parameter "q"!');
        }
        $data = [];
        $modelClass = $this->modelClass;
        $listMethod = $this->listMethod;
        if (!is_null($params['q'])) {
            $data['results'] = $modelClass::$listMethod($this->keyAttribute, $this->valueAttribute, "{$this->queryAttribute} like '%{$params['q']}%'", $params);
        } else {
            $data['results'] = $modelClass::$listMethod($this->keyAttribute, $this->valueAttribute, '', $params);
        }
        return $data;
    }
396342
protected function call_handler($name, array $params = array())
    {
        if(array_key_exists($name,$this->call_handlers)) {
            go(function () use ($name, $params) {
                sd_call_user_func_array($this->call_handlers[$name], $params);
            });
        }
    }