Check required data for rendering use.
@return array|boolean
765613
protected function requirementCheck()
    {
        if(count($this->required) > 0)
        {
            // non-exists list
            $nonExist	= array();

            foreach($this->required as $k)
            {
                if(!isset($this->data[$k]))
                {
                    $nonExist[]	= $k;
                }
            }

            if(count($nonExist) > 0)
                return $nonExist;
        }

        return false;
    }
875634
private function displayRequirements()
    {
        $requirements = $this->getChecker()->requirements();

        $this->frame('Application requirements');

        $this->table([
            'Status', 'Message'
        ], [
            [$requirements['status'], $requirements['message']]
        ]);
    }
472862
public function requirements_met() {
		$met = true;

		foreach ( $this->requirements as $requirement ) {
			$met = $met && $requirement->is_met();
		}

		return $met;
	}
405787
public function needCache(){
		// disabled from configs
		if($this->disabled){
			return false;
		}

		// is post request
		if(Yii::$app->request->isPost){
			return false;
		}

		// has request parameter `disallowHtmlCache`
		if(Yii::$app->request->get('disallowHtmlCache')){
			return false;
		}

		// checking for excluded actions
		$excluded_actions = isset($this->excluded_actions[$this->_controller->id]) ? $this->excluded_actions[$this->_controller->id] : array();
		if($excluded_actions && in_array($this->_action->id, $excluded_actions)){
			return false;
		}

		// Checking for excluded params
		$excluded_params = isset($this->excluded_params[$this->_controller->id]) ? $this->excluded_params[$this->_controller->id] : array();

		foreach($excluded_params as $param => $value){
			if(is_numeric($param)){
				$param = $value;
				$value = null;
			}
			elseif(!is_array($value)){
				$value = array($value);
			}

			if(!isset($this->_controller->{$param})){
				continue;
			}

			if(is_null($value) && $this->_controller->{$param}){
				return false;
			}
			elseif(!is_null($value) && in_array($this->_controller->{$param}, $value)){
				return false;
			}
		}

		return true;
	}
281174
protected function validationData()
    {
        return $this->merge([
            // Default value.
            'is_approved' => 'owner' == user('role') or ! setting('comments.moderate'),
            'parent_id' => $this->input('parent_id', null),
            // Default value from route.
            'commentable_id' => $this->route('commentable_id'),
            'commentable_type' => string_slug($this->route('commentable_type'), '_'),
            // Aditional default value.
            'user_ip' => $this->ip(),
        ])->all();
    }
1084360
public function checkRegistryRequestsAnswers()
    {
        if ($this->cache) {
            $cacheId = $this->_getCacheId();
            $this->_data = $this->cache->load($cacheId);
        } else {
            $cacheId = false;
        }

        if (! $this->_data) {
            $this->_data = $this->loadData($this->_id);

            if ($cacheId) {
                $this->cache->save($this->_data, $cacheId, $this->_cacheTags);
            }
        }
        // \MUtil_Echo::track($this->_data);

        $this->exists = is_array($this->_data);

        return ($this->exists || (! $this->requireArray)) && parent::checkRegistryRequestsAnswers();
    }
244405
public function hasRenderer()
    {
        if (!isset($this->_data['renderer'])) {
            return false;
        }

        if (is_string($this->_data['renderer'])) {
            // Renderer class name has been given
            $renderer = $this->_data['renderer'];
            $namespace = ResourceTable::collection()->rendererNamespace();
            if ($namespace) {
                $renderer = $namespace.'\\'.$renderer;
            }
            if (!class_exists($renderer)) {
                return false;
            }
            if (!method_exists($renderer, 'render') || !is_callable([$renderer, 'render'])) {
                return false;
            }
        }

        return true;
    }
351865
public function checkDATA() {
        if (!defined(DATA))
                define(DATA,
                    __DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR);

        if (!is_dir(DATA)) mkdir(DATA, 0777, true);

        return $this;
    }
117987
public function checkRequiredTables() {
        if ($this->requiredTables) {
            $this->out(sprintf('The following tables are required: <info>%s</info>', implode(', ', $this->requiredTables)));
            $this->out('<success>Checking tables...</success>');

            $tables = $this->db->listSources();
            $missing = array();

            foreach ($this->requiredTables as $table) {
                if (!in_array($this->db->config['prefix'] . $table, $tables)) {
                    $missing[] = $table;
                }
            }

            if ($missing) {
                $this->err(sprintf('<error>Missing tables %s; can not proceed</error>', implode(', ', $missing)));
                return false;
            }
        }

        $this->out('<success>Table status good, proceeding...</success>');
        return true;
    }
788017
public function getInvalidData()
    {
        return array_combine(
            array_keys($this->invalidAttribs),
            array_map(function ($ref) {
                return $ref['value'];
            }, array_values($this->invalidAttribs))
        );
    }
999058
public function valid()
    {
        // initialize/refresh cursor
        if ($this->cursor != 0 && !isset($this->elements[$this->index])) {
            $this->scan();
        }

        return isset($this->elements[$this->index]);
    }
1023485
public function processRequirements()
    {
        foreach ($this->requirements as $requirement)
        {
            if ( ! call_user_func($requirement, $this->resource, $this))
            {
                return false;
            }
        }

        return true;
    }
660956
public function getData()
    {
        $this->validate('merchantId', 'merchantPassword', 'acquirerId', 'transactionId', 'amount');

        $data = [
            'AcquirerId'       => $this->getAcquirerId(),
            'Amount'           => $this->formatAmount(),
            'CurrencyExponent' => $this->getCurrencyDecimalPlaces(),
            'MerchantId'       => $this->getMerchantId(),
            'ModificationType' => $this->getModificationType(),
            'OrderNumber'      => $this->getTransactionId(),
            'Password'         => $this->getMerchantPassword()
        ];

        return $data;
    }
73020
public function checkRegistryRequestsAnswers()
    {

        if (! $this->organizationId) {
            if ($this->respondent) {
                $this->organizationId = $this->respondent->getOrganizationId();
            }
            if (! $this->organizationId) {
                $this->organizationId = $this->request->getParam(\MUtil_Model::REQUEST_ID2);
            }
        }

        if ($this->organizationId && (! $this->respondentId)) {
            if ($this->respondent) {
                $this->respondentId = $this->respondent->getId();
            }
            if (! $this->respondentId) {
                $this->respondentId = $this->util->getDbLookup()->getRespondentId(
                        $this->request->getParam(\MUtil_Model::REQUEST_ID1),
                        $this->organizationId
                        );
            }
        }

        return $this->organizationId && $this->respondentId && $this->db && $this->model;
    }
565648
public function checkRequired()
    {
        if (is_array($this->value)) {
            return (bool) $this->value;
        }

        $value = (string) $this->value;

        return $this->value || $value === '0';
    }
899645
protected function validateRequired()
  {
    if ($this->isRequired() && empty($this->value)) {
      $this->addError(sprintf($this->tmpl_err_required, $this->getName()));

      return false;
    }

    return true;
  }
135838
public function getData()
    {
        $this->validate('merchantId', 'merchantPassword', 'acquirerId', 'transactionId');

        $data = [
            'AcquirerId'  => $this->getAcquirerId(),
            'MerchantId'  => $this->getMerchantId(),
            'Password'    => $this->getMerchantPassword(),
            'OrderNumber' => $this->getTransactionId()
        ];

        return $data;
    }