Check if the DB is able to safely query this model

@return bool
438717
protected static function databaseIsReady()
    {
        $object = DataObject::singleton(static::class);

        // if any of the tables aren't created in the database
        $table = $object->baseTable();
        if (!ClassInfo::hasTable($table)) {
            return false;
        }

        // if any of the tables don't have all fields mapped as table columns
        $dbFields = DB::field_list($table);
        if (!$dbFields) {
            return false;
        }

        $objFields = $object->getSchema()->databaseFields($object, false);
        $missingFields = array_diff_key($objFields, $dbFields);

        if ($missingFields) {
            return false;
        }

        return true;
    }
712617
public function isRecordOriginModifiable()
    {
        $retVal = false;
        if ($this->isRecordOriginFlagSet()) {
            $retVal = $this->def->getService()->getRecordOriginModifiable();
        }

        return $retVal;
    }
1082547
public function isBlocked()
    {
        $ip = $this->getIp();
        $this->deleteAttempts($ip, false);

        // INET_ATON
        $query = "SELECT count(*) FROM {$this->config->table_attempts} WHERE ip = :ip";
        $query_prepared = $this->dbh->prepare($query); // INET_ATON(:ip)
        $query_prepared->execute(['ip' => $ip]);
        $attempts = $query_prepared->fetchColumn();

        if ($attempts < intval($this->config->attempts_before_verify)) {
            return "allow";
        }

        if ($attempts < intval($this->config->attempts_before_ban)) {
            return "verify";
        }

        return "block";
    }
506451
public function canPreview()
    {
        $blCan = null;
        if (($sPrevId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('preview')) &&
            ($sAdminSid = \OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie('admin_sid'))
        ) {
            $sTable = getViewName('oxuser');
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $sQ = "select 1 from $sTable where MD5( CONCAT( " . $oDb->quote($sAdminSid) . ", {$sTable}.oxid, {$sTable}.oxpassword, {$sTable}.oxrights ) ) = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sPrevId);
            $blCan = (bool) $oDb->getOne($sQ);
        }

        return $blCan;
    }
833193
public function isQuery()
    {
        if (false === $this->hasFilter(self::FILTER_QUERY)) {
            return false;
        }
        $query = $this->getFilter(self::FILTER_QUERY);
        return isset($query[self::FILTER_QUERY_CRITERIA]);
    }
1156600
public function checkIsAvailable()
    {
        try {
            $domain = mb_strtolower($this->fqdn);
            $check = Domain::perform('check', ['domains' => [$domain]], ['batch' => true]);
            $this->isAvailable = isset($check[$domain]) && $check[$domain] === 1;
        } catch (ResponseErrorException $e) {
            $this->isAvailable = false;
        }

        return $this->isAvailable;
    }
377420
public function valid()
    {

        if ($this->container['region'] === null) {
            return false;
        }
        $allowed_values = $this->getRegionAllowableValues();
        if (!in_array($this->container['region'], $allowed_values)) {
            return false;
        }
        if ($this->container['machineType'] === null) {
            return false;
        }
        $allowed_values = $this->getMachineTypeAllowableValues();
        if (!in_array($this->container['machineType'], $allowed_values)) {
            return false;
        }
        if ($this->container['size'] === null) {
            return false;
        }
        if ($this->container['billingType'] === null) {
            return false;
        }
        $allowed_values = $this->getBillingTypeAllowableValues();
        if (!in_array($this->container['billingType'], $allowed_values)) {
            return false;
        }
        if ($this->container['machineName'] === null) {
            return false;
        }
        if ($this->container['templateId'] === null) {
            return false;
        }
        return true;
    }
158536
public function checkSecure()
    {
        if ($this->secure === null)
            return true;

        $in_secure = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on';
        return ($this->secure && $in_secure) || (! $this->secure && ! $in_secure);
    }
395063
public function isSecure()
    {
        if ($this->isUsingTrustedProxy() && $this->server->has(self::$trustedHeaderNames[RequestHeaderConstants::CLIENT_PROTO])) {
            $protocolString = $this->server->get(self::$trustedHeaderNames[RequestHeaderConstants::CLIENT_PROTO]);
            $protocols = explode(',', $protocolString);

            return count($protocols) > 0 && in_array(strtolower($protocols[0]), ['https', 'ssl', 'on']);
        }

        return $this->server->has('HTTPS') && strtolower($this->server->get('HTTPS')) !== 'off';
    }
1225969
public function valid()
    {

        if ($this->container['fuelBayView'] === null) {
            return false;
        }
        $allowedValues = $this->getFuelBayViewAllowableValues();
        if (!in_array($this->container['fuelBayView'], $allowedValues)) {
            return false;
        }
        if ($this->container['fuelBayTake'] === null) {
            return false;
        }
        $allowedValues = $this->getFuelBayTakeAllowableValues();
        if (!in_array($this->container['fuelBayTake'], $allowedValues)) {
            return false;
        }
        if ($this->container['anchor'] === null) {
            return false;
        }
        $allowedValues = $this->getAnchorAllowableValues();
        if (!in_array($this->container['anchor'], $allowedValues)) {
            return false;
        }
        if ($this->container['unanchor'] === null) {
            return false;
        }
        $allowedValues = $this->getUnanchorAllowableValues();
        if (!in_array($this->container['unanchor'], $allowedValues)) {
            return false;
        }
        if ($this->container['online'] === null) {
            return false;
        }
        $allowedValues = $this->getOnlineAllowableValues();
        if (!in_array($this->container['online'], $allowedValues)) {
            return false;
        }
        if ($this->container['offline'] === null) {
            return false;
        }
        $allowedValues = $this->getOfflineAllowableValues();
        if (!in_array($this->container['offline'], $allowedValues)) {
            return false;
        }
        if ($this->container['allowCorporationMembers'] === null) {
            return false;
        }
        if ($this->container['allowAllianceMembers'] === null) {
            return false;
        }
        if ($this->container['useAllianceStandings'] === null) {
            return false;
        }
        if ($this->container['attackIfOtherSecurityStatusDropping'] === null) {
            return false;
        }
        if ($this->container['attackIfAtWar'] === null) {
            return false;
        }
        return true;
    }
429607
protected function validateData()
    {
        foreach ($this->relationalData as $attribute => &$data) {
            /** @var ActiveRecord $model */
            /** @var ActiveQuery $activeQuery */
            $activeQuery = $data['activeQuery'];
            foreach ($data['newModels'] as &$model) {
                if (!$model->validate()) {
                    $_errors = $model->getErrors();
                    $errors = [];

                    foreach ($_errors as $relatedAttribute => $error) {
                        if (!$activeQuery->multiple || !isset($activeQuery->link[$relatedAttribute])) {
                            $errors[$relatedAttribute] = $error;
                        }
                    }

                    if (count($errors)) {
                        $this->owner->addError($attribute, $errors);

                        return false;
                    }
                }
            }
        }

        return true;
    }
651680
public function isLocked()
    {
        if($this->getModel()->getState()->isUnique())
        {
            $entity = $this->getModel()->fetch();

            if($entity->isLockable() && $entity->isLocked()) {
                return true;
            }
        }

        return false;
    }
774534
function isSeekable()
    {
        if (!$this->_assertUsable())
            return false;

        if ($this->getMetadata('wrapper_type')) {
            // This is a wrapper resource; challenge seekable ...
            $pos = $this->tell();
            if (-1 === @fseek($this->rHandler, $pos, SEEK_SET))
                return false;
        }

        return $this->getMetadata('seekable');
    }
540693
public function valid()
    {

        $allowedValues = $this->getStatusAllowableValues();
        if (!in_array($this->container['status'], $allowedValues)) {
            return false;
        }
        return true;
    }
10624
public function hasQuery()
    {
        if (func_num_args() == 0) {
            return !empty($this->query);
        }

        foreach (func_get_args() as $key) {
            if (!$this->hasParam($this->query, $key)) {
                return false;
            }
        }

        return true;
    }
253604
public function IsSecure () {
		if ($this->secure === NULL) 
			$this->secure = in_array($this->GetScheme(), [
				static::SCHEME_HTTPS,
				static::SCHEME_FTPS,
				static::SCHEME_IRCS,
				static::SCHEME_SSH
			], TRUE);
		return $this->secure;
	}
1317728
public function isAvailable()
    {
        $isDebugging = $this->_logger->isHandling(ehough_epilog_Logger::DEBUG);

        if (! function_exists('fopen')) {

            if ($isDebugging) {

                $this->_logger->debug('fopen() is not available.');
            }

            return false;
        }

        if (function_exists('ini_get') && ini_get('allow_url_fopen') != true) {

            if ($isDebugging) {

                $this->_logger->debug('allow_url_fopen is set to false.');
            }

            return false;
        }

        return true;
    }