Returns true if a databox is available given a configuration.

@param \databox $databox

@return bool
963483
public function isDataboxAvailable(\databox $databox)
    {
        if (!$this->isRestricted()) {
            return true;
        }

        return in_array($databox->get_sbas_id(), $this->availableDataboxes, true);
    }
1250251
public function has(string $name) : bool
    {
        try {
            $result = $this->configCommand($name);
        } catch (RuntimeException $exception) {
            return false;
        }

        return $result->isSuccessful();
    }
271303
public function hasType($dataObjectClass)
    {
        foreach ($this->types as $scaffold) {
            if ($scaffold->getDataObjectClass() == $dataObjectClass) {
                return true;
            }
        }

        return false;
    }
1045665
protected function ensureMigrateColumn(\databox $databox)
    {
        try {
            $sql = 'ALTER TABLE `record`
                    ADD `migrate35` TINYINT( 1 ) UNSIGNED NOT NULL ,
                    ADD INDEX ( `migrate35` ) ';
            $stmt = $databox->get_connection()->prepare($sql);
            $stmt->execute();
            $stmt->closeCursor();
        } catch (\Exception $e) {

        }
    }
684456
public function check($input)
    {
        if ($this->lazy) {
            $this->lazy = false;
            $this->parseDefinition();
        }
        $this->lastValue = $input;
        if (strlen($input) === 0 && $this->skipEmpty) {
            return true;
        }
        $constraint = $this->constraint;
        return $constraint($input, $this, $this->attrib, $this->dataFilter);
    }
869820
public function determineWhichRowsAreSelectable()
    {
        if ($this->config->row_picker_match_rows_by === false) {
            return;
        }

        // collect all selectable rows
        $self = $this;

        $this->dataTable->filter(function ($dataTable) use ($self) {
            /** @var DataTable $dataTable */

            foreach ($dataTable->getRows() as $row) {
                $rowLabel = $row->getColumn('label');

                if (false === $rowLabel) {
                    continue;
                }

                // build config
                if (!isset($self->selectableRows[$rowLabel])) {
                    $self->selectableRows[$rowLabel] = array(
                        'label'     => $rowLabel,
                        'matcher'   => $rowLabel,
                        'displayed' => $self->isRowVisible($rowLabel)
                    );
                }
            }
        });
    }
312375
public function getBitPositionInDatabox(\databox $databox)
    {
        foreach ($databox->getStatusStructure() as $bit => $status) {
            $candidate_name = self::normalizeName($status['labelon']);
            if ($candidate_name === $this->name) {
                return (int) $status['bit'];
            }
        }
    }
282466
private function isExistingPropertyGetterAvailable(string $propertyName): bool
    {
        assert($this->propertyExists($propertyName));
        if ($this->isExistingPropertyVirtual($propertyName)) {
            return !is_null($this->virtualGetters[$propertyName]);
        } else {
            return $this->realGetAvailable[$propertyName];
        }
    }
137697
public function countUnseen($mailbox)
    {
        // Check internal cache
        $cache = $this->data['STATUS:'.$mailbox];
        if (!empty($cache) && isset($cache['UNSEEN'])) {
            return (int) $cache['UNSEEN'];
        }

        // Try STATUS (should be faster than SELECT+SEARCH)
        $counts = $this->status($mailbox);
        if (is_array($counts)) {
            return (int) $counts['UNSEEN'];
        }

        // Invoke SEARCH as a fallback
        $index = $this->search($mailbox, 'ALL UNSEEN', false, array('COUNT'));
        if (!$index->is_error()) {
            return $index->count();
        }

        return false;
    }
839685
public function setMailbox($mailbox = 'INBOX')
    {

        if ($mailbox == 'INBOX') {
            $mailbox = "{".$this->settings['server']."}INBOX";
        } else {
            $mailbox = "{".$this->settings['server']."}INBOX.".imap_utf7_encode($mailbox);
        }

        $result = false;

        if ($this->conn) {
            $result = imap_reopen($this->conn, $mailbox);
            $this->mailbox = $mailbox;
        }

        return $result;
    }
1117131
public function is_accessible() {
        $available = $this->properties->available;
        $deadline = $this->properties->deadline;
        return (($available == 0 || time() >= $available) && ($deadline == 0 || time() < $deadline));
    }
78893
public function isEnabled(Widget $widget)
    {
        $widgets = $this->container->getParameter('victoire_core.widgets');
        foreach ($widgets as $widgetParams) {
            if ($widgetParams['class'] === ClassUtils::getClass($widget)) {
                return true;
            }
        }

        return false;
    }
413180
public function unmountDatabase(Request $request, $databox_id)
    {
        $success = false;

        try {
            $databox = $this->findDataboxById($databox_id);
            $databox->unmount_databox();

            $success = true;
        } catch (\Exception $e) {

        }

        if ('json' === $request->getRequestFormat()) {
            $msg = $success
                ? $this->app->trans('The publication has been stopped')
                : $this->app->trans('An error occured');
            return $this->app->json([
                'success' => $success,
                'msg'     => $msg,
                'sbas_id' => $databox_id
            ]);
        }

        return $this->app->redirectPath('admin_databases', [
            'reload-tree' => 1,
        ]);
    }
1170187
public static function getBox($box)
    {
        return isset(self::$data[$box]) ? self::$data[$box] : null;
    }
121028
public function exists()
    {
        try {
            $this->connection->getDataset($this->identity + ['fields' => 'datasetReference']);
        } catch (NotFoundException $ex) {
            return false;
        }

        return true;
    }
879933
function isDatatable($table){
    if($table.dataTableSettings){
      for(var i = 0; i < $table.dataTableSettings.length; i++){
        var table = $table.dataTableSettings[i].nTable;
        if($table[0] == table){
          return true;
        }
      }
    }
    return false;
  }
501332
public static function isAvailable()
    {
        try {
            self::_initialize();
        } catch (RoleEnvironmentNotAvailableException $ex) {
            return false;
        } catch (ChannelNotAvailableException $ex) {
            return false;
        }

        return self::$_runtimeClient != null;
    }