Loads data from DB using modelCondition and fills $rows and $total attributes
with the real values.
765165
protected function extractData() {
        if (is_null($this->dataProvider) || !is_a($this->dataProvider, '\\mpf\\datasources\\DataProvider'))
            throw new WidgetException("Data Provider was not specified!", WidgetException::CODE_MISSING_CONFIG, null, __CLASS__, 'modelCondition');
        if (is_null($this->columns))
            throw new WidgetException("No Columns were specified!", WidgetException::CODE_MISSING_CONFIG, null, __CLASS__, 'columns');
        $this->dataProvider->getData();
        $this->initColumns();
    }
46304
public function load()
    {
        if (!empty($this->_statements)) {
            return;
        }

        foreach ($this->data as $type=>$item) {
            if (!is_array($item)) {
                $item = array( $item );
            }
            $use_statements = Config::get('use-statements');
            $adapter_name = isset($use_statements[$type]) ? $use_statements[$type] : null;
            if (!empty($adapter_name)) {
                $cls_name = 'AssetsManager\Package\PresetAdapter\\'.$adapter_name;
                if (@class_exists($cls_name)) {
                    $interfaces = class_implements($cls_name);
                    $config_interface = Config::getInternal('assets-preset-adapter-interface');
                    if (in_array($config_interface, $interfaces)) {
                        if (!isset($this->_statements[$type])) {
                            $this->_statements[$type] = array();
                        }
                        foreach ($item as $item_ctt) {
                            if (!is_array($item_ctt)) {
                                $item_ctt = array( $item_ctt );
                            }
                            $statement = new $cls_name($item_ctt, $this);
                            $statement->parse();
                            $this->_statements[$type][] = $statement;
                        }
                    } else {
                        throw new \DomainException(
                            sprintf('Preset statement class "%s" must implement interface "%s"!',
                                $cls_name, $config_interface)
                        );
                    }
                } else {
                    throw new \DomainException(
                        sprintf('Preset statement class "%s" not found!', $cls_name)
                    );
                }
            } else {
                throw new \LogicException(
                    sprintf('Unknown preset statement type "%s" in preset "%s"!', $type, $this->getName())
                );
            }
        }
    }
606495
private function _fill()
    {

        if (empty($this->db)) return false;

        $sql = (string)"SHOW VARIABLES";
        $res = $this->db->query((string)$sql);

        if (!$res) return false;

        $data = $this->db->fetch_assoc_list($res);
        if (!empty($data)) {
            foreach ($data as $variable) {
                $this->$variable[(string)'Variable_name'] = (string)$variable['Value'];
            }
            $this->db->free($res);
        }

        // clear all the unecessary variables and the endles recursion of the db
        unset($this->db, $data, $variable);

        return true;
    }
1227897
public function afterModelFetch()
    {
        $this->fieldValues = $this->model->value ?: [];
        $this->model->attributes = array_merge($this->fieldValues, $this->model->attributes);
    }
1184622
def load_more_data(self, value, rows=False, columns=False):
        """"""
        try:
            if rows and value == self.verticalScrollBar().maximum():
                self.model().fetch_more(rows=rows)
                self.sig_fetch_more_rows.emit()
            if columns and value == self.horizontalScrollBar().maximum():
                self.model().fetch_more(columns=columns)
                self.sig_fetch_more_columns.emit()

        except NameError:
            # Needed to handle a NameError while fetching data when closing
            # See issue 7880
            pass
678124
public function load($sql)
    {
        $query = '';
        $delimiter = ';';
        $delimiterLength = 1;

        $dollarsOpen = false;
        foreach ($sql as $sqlLine) {
            if (preg_match('/DELIMITER ([\;\$\|\\\\]+)/i', $sqlLine, $match)) {
                $delimiter = $match[1];
                $delimiterLength = strlen($delimiter);
                continue;
            }

            $parsed = trim($query) == '' && $this->sqlLine($sqlLine);
            if ($parsed) {
                continue;
            }

            // Ignore $$ inside SQL standard string syntax such as in INSERT statements.
            if (!preg_match('/\'.*\$\$.*\'/', $sqlLine)) {
                $pos = strpos($sqlLine, '$$');
                if (($pos !== false) && ($pos >= 0)) {
                    $dollarsOpen = !$dollarsOpen;
                }
            }

            if (preg_match('/SET search_path = .*/i', $sqlLine, $match)) {
                $this->searchPath = $match[0];
            }

            $query .= "\n" . rtrim($sqlLine);

            if (!$dollarsOpen && substr($query, -1 * $delimiterLength, $delimiterLength) == $delimiter) {
                $this->sqlQuery(substr($query, 0, -1 * $delimiterLength));
                $query = '';
            }
        }

        if ($query !== '') {
            $this->sqlQuery($query);
        }
    }
355820
def populateFromRow(self, featureSetRecord):
        
        self._dbFilePath = featureSetRecord.dataurl
        self.setAttributesJson(featureSetRecord.attributes)
        self.populateFromFile(self._dbFilePath)
1290601
protected function loadDataModels()
    {
        $schemas = [];
        $totalNbTables   = 0;
        $dataModelFiles  = $this->getSchemas();
        $defaultPlatform = $this->getGeneratorConfig()->getConfiguredPlatform();

        // Make a transaction for each file
        foreach ($dataModelFiles as $schema) {
            $dmFilename = $schema->getPathName();
            $this->log('Processing: ' . $schema->getFileName());

            $dom = new \DOMDocument('1.0', 'UTF-8');
            $dom->load($dmFilename);

            $this->includeExternalSchemas($dom, $schema->getPath());

            // normalize (or transform) the XML document using XSLT
            if ($this->getGeneratorConfig()->get()['generator']['schema']['transform'] && $this->xsl) {
                $this->log('Transforming ' . $dmFilename . ' using stylesheet ' . $this->xsl->getPath());

                if (!class_exists('\XSLTProcessor')) {
                    $this->log('Could not perform XLST transformation. Make sure PHP has been compiled/configured to support XSLT.');
                } else {
                    // normalize the document using normalizer stylesheet
                    $xslDom = new \DOMDocument('1.0', 'UTF-8');
                    $xslDom->load($this->xsl->getAbsolutePath());
                    $xsl = new \XsltProcessor();
                    $xsl->importStyleSheet($xslDom);
                    $dom = $xsl->transformToDoc($dom);
                }
            }

            // validate the XML document using XSD schema
            if ($this->validate && $this->xsd) {
                $this->log('  Validating XML using schema ' . $this->xsd->getPath());

                if (!$dom->schemaValidate($this->xsd->getAbsolutePath())) {
                    throw new EngineException(sprintf("XML schema file (%s) does not validate. See warnings above for reasons validation failed (make sure error_reporting is set to show E_WARNING if you don't see any).", $dmFilename), $this->getLocation());
                }
            }

            $xmlParser = new SchemaReader($defaultPlatform, $this->dbEncoding);
            $xmlParser->setGeneratorConfig($this->getGeneratorConfig());
            $schema = $xmlParser->parseString($dom->saveXML(), $dmFilename);
            $nbTables = $schema->getDatabase(null, false)->countTables();
            $totalNbTables += $nbTables;

            $this->log(sprintf('  %d tables processed successfully', $nbTables));

            $schema->setName($dmFilename);
            $schemas[] = $schema;
        }

        $this->log(sprintf('%d tables found in %d schema files.', $totalNbTables, count($dataModelFiles)));

        if (empty($schemas)) {
            throw new BuildException('No schema files were found (matching your schema fileset definition).');
        }

        foreach ($schemas as $schema) {
            // map schema filename with database name
            $this->dataModelDbMap[$schema->getName()] = $schema->getDatabase(null, false)->getName();
        }

        if (count($schemas) > 1 && $this->getGeneratorConfig()->get()['generator']['packageObjectModel']) {
            $schema = $this->joinDataModels($schemas);
            $this->dataModels = [$schema];
        } else {
            $this->dataModels = $schemas;
        }

        foreach ($this->dataModels as &$schema) {
            $schema->doFinalInitialization();
        }

        $this->dataModelsLoaded = true;
    }
582866
public static function findByAttributes($attributes, $condition = null, $params = [])
    {
        if (!is_a($condition, '\\mpf\\datasources\\sql\\ModelCondition'))
            $condition = ModelCondition::getFrom($condition, get_called_class());
        /* @var $condition \mpf\datasources\sql\ModelCondition */
        $oldLimit = $condition->limit;
        $condition->limit = 1;
        $models = static::findAllByAttributes($attributes, $condition, $params);
        $condition->limit = $oldLimit;
        return isset($models[0]) ? $models[0] : null;
    }
274855
def load
      query = (arguments or self).info_sql
      Squirm.exec(query, [name, schema]) do |result|
        validate result
        set_values_from result
      end
      self
    end
464087
private function load()
    {
        $reflectionClass = new \ReflectionClass($this->name);
        $this->collectionInfo = new CollectionInfo();

        foreach ($this->reader->getClassAnnotations($reflectionClass) as $annotation) {
            $this->processClassAnnotation($annotation);
        }

        $properties = $reflectionClass->getProperties();

        foreach ($properties as $property) {
            foreach ($this->reader->getPropertyAnnotations($property) as $annotation) {
                if (!isset($this->propertiesInfos[$property->getName()])) {
                    $this->propertiesInfos[$property->getName()] = new PropertyInfo();
                }
                $this->processPropertiesAnnotation($property->getName(), $annotation);
            }
        }

        $this->eventManager = new EventManager();
        if ($this->hasEvent) {
            $methods = $reflectionClass->getMethods();
            foreach ($methods as $method) {
                $annotations = $this->reader->getMethodAnnotations($method);
                if (!empty($annotations)) {
                    foreach ($annotations as $annotation) {
                        if (in_array('JPC\MongoDB\ODM\Annotations\Event\Event', class_implements($annotation))) {
                            $this->eventManager->add($annotation, $method->getName());
                        }
                    }
                }
            }
        }

        $this->loaded = true;
    }
1056779
private function loadDataInBatch(string $mode): void
    {
        $fields = array_keys($this->configEntities[$this->entity]['cols']);
        // Replace by all fields if update as we have to load everything
        if ($mode === 'update') {
            $fields = array_keys($this->entityCols);
        }

        // Load the data from the helper, only if pretend is false
        $filename = $this->csv->getRealPath();
        $this->dbHelper->setPretend($this->pretend);
        $sql = $this->dbHelper->loadData($this->entity, $filename, $fields, $mode);

        $this->returnRes === true ? array_push($this->queries, $sql) : null;

        // Destroy the file
        unlink($this->csv->getRealPath());
    }
105899
private function loadColumns(): void
  {
    $rows = DataLayer::getAllTableColumns();
    foreach ($rows as $row)
    {
      $row['length']                                          = DataTypeHelper::deriveFieldLength($row);
      $this->columns[$row['table_name']][$row['column_name']] = $row;
    }
  }
1161717
def populateFromRow(self, quantificationSetRecord):
        
        self._dbFilePath = quantificationSetRecord.dataurl
        self.setAttributesJson(quantificationSetRecord.attributes)
        self._db = SqliteRnaBackend(self._dbFilePath)
        self.addRnaQuants()
567665
public function load_data() {
        global $DB;

        // Load the field object.
        if (($this->fieldid == 0) or (!($field = $DB->get_record('user_info_field', array('id' => $this->fieldid))))) {
            $this->field = null;
            $this->inputname = '';
        } else {
            $this->set_field($field);
        }

        if (!empty($this->field) && $this->userid > 0) {
            $params = array('userid' => $this->userid, 'fieldid' => $this->fieldid);
            if ($data = $DB->get_record('user_info_data', $params, 'data, dataformat')) {
                $this->set_user_data($data->data, $data->dataformat);
            }
        } else {
            $this->data = null;
        }
    }
433110
public final function loadModel(): void
    {
        if ($this->model != null) {
            return;
        }

        $file = sprintf('%s/app/service/%s/model/model.php', APP_DIR, $this->name);
        if (!file_exists($file)) {
            throw new ServiceException("Cannot load {$this->name} model, model file app/service/{$this->name}".
                "/model/model.php not found");
        }

        // FooService => FooModel
        $class = sprintf('froq\\app\\database\\%sModel', substr($this->name, 0, -strlen(self::SERVICE_NAME_SUFFIX)));
        if (!class_exists($class)) {
            throw new ServiceException("Cannot load {$this->name} model, model class {$class} not found");
        }

        $this->model = new $class($this);
    }
626915
function fill() {

        if (self.pgrid.filteredDataSource != null && self.dimensionsCount > 0) {

            var datasource = self.pgrid.filteredDataSource;
            if (datasource != null && utils.isArray(datasource) && datasource.length > 0) {
                for (var rowIndex = 0, dataLength = datasource.length; rowIndex < dataLength; rowIndex++) {
                    var row = datasource[rowIndex];
                    var dim = self.root;
                    for (var findex = 0; findex < self.dimensionsCount; findex++) {
                        var depth = self.dimensionsCount - findex;
                        var subfield = self.fields[findex];
                        var subvalue = row[subfield.name];
                        var subdimvals = dim.subdimvals;

                        if (subdimvals[subvalue] !== undefined) {
                            dim = subdimvals[subvalue];
                        } else {
                            dim.values.push(subvalue);
                            dim = new Dimension(++dimid, dim, subvalue, subfield, depth, false, findex == self.dimensionsCount - 1);
                            subdimvals[subvalue] = dim;
                            dim.rowIndexes = [];
                            self.dimensionsByDepth[depth].push(dim);
                        }

                        dim.rowIndexes.push(rowIndex);
                    }
                }
            }
        }
    }