Fetch new record
765106
public function setUp() {
        $this->sourceTable->next();
        $this->currentIndex = $this->sourceTable->key();
        $this->currentField = $this->sourceTable->current();
    }
1373818
public function fetchNextArray()
	{
		if( $this->cursor < $this->RecordCount() )
		{
			$this->cursor ++;
			$row = $this->rows[$this->cursor-1];
			return $row->getPairs();
		}
		else return FALSE;
	}
419419
def _fetch_new(&client_block)
      if (@never_block || (_total_current_size < @max_size))
        if client_block.arity == 0
          nc = yield
        else
          nc = yield @sessions_key
        end
        HotTub.logger.info "[HotTub] Adding client: #{nc.class.name} to #{@name}." if HotTub.log_trace?
        nc
      end
    end
259224
def fetch(self, invoice_id, data={}, **kwargs):
        "
        return super(Invoice, self).fetch(invoice_id, data, **kwargs)
381999
function updateQueryForNextPage(pulledRecords) {
        return Platform.async(function(callback) {
            callback();
        })().then(function() {

            if (!pulledRecords) {
                throw new Error('Something is wrong. pulledRecords cannot be null at this point');
            }

            var lastRecord = pulledRecords[ pulledRecords.length - 1];

            if (!lastRecord) {
                throw new Error('Something is wrong. Possibly invalid response from the server. lastRecord cannot be null!');
            }

            var lastRecordTime = lastRecord[tableConstants.sysProps.updatedAtColumnName];

            if (!_.isDate(lastRecordTime)) {
                throw new Error('Property ' + tableConstants.sysProps.updatedAtColumnName + ' of the last record should be a valid date');
            }

            if (lastRecordTime.getTime() === lastKnownUpdatedAt.getTime()) {
                pagePullQuery.skip(pagePullQuery.getComponents().skip + pulledRecords.length);
            } else {
                buildQueryFromLastKnownUpdateAt(lastRecordTime);
            }
        });
    }
595340
public function fetch($i = 1)
    {
        $generator = $this->getGenerator();
        $cache = $this->faker->getCache();
        $table = $this->query->getTable();
        $fields = $cache->getTable($table);
        $record = new $this->recordClass;
        foreach ([$table, $table . '_i18n'] as $t) {
            $fields = $cache->getTable($t);
            foreach ($fields['fields'] as $field => $meta) {
                try {
                    $record->{$field} = $generator->{$field};
                    continue;
                } catch (Throwable $e) {
                }
                if ($meta['name'] == 'id') {
                    $record->{$field} = $i;
                } elseif ($meta['name'] == 'parent_id') {
                    $parentId = $i % 10 - 1;
                    $record->{$field} = $parentId > 0 ? $parentId : null;
                } elseif (substr($meta['name'], 0, 3) == 'dt_') {
                    if (strpos($meta['name'], 'added', 3)) {
                        $record->{$field} = date(
                            'Y-m-d H:i:s',
                            strtotime(round(rand(0, 100000) - rand(0, 10000)) . ' seconds')
                        );
                    } elseif (strpos($meta['name'], 'updated', 3)) {
                        $record->{$field} = date('Y-m-d H:i:s', strtotime(-round(rand(0, 100000)) . ' seconds'));
                    } elseif (strpos($meta['name'], 'deleted', 3)) {
                        $record->{$field} = rand(0, 1) > 0.9 || true
                            ? date('Y-m-d H:i:s', strtotime(-round(rand(0, 100000)) . ' seconds'))
                            : null;
                        $record->{$field} = date('Y-m-d H:i:s', strtotime(-round(rand(0, 100000)) . ' seconds'));
                    } else {
                        ddd($meta);
                    }
                } elseif ($meta['name'] == 'language_id') {
                    $record->{$field} = 'en';
                } elseif ($meta['name'] == 'title') {
                    $record->{$field} = $generator->sentence(rand(3, 9));
                } elseif ($meta['name'] == 'subtitle') {
                    $record->{$field} = implode(' ', $generator->sentences(rand(1, 4)));
                } elseif ($meta['name'] == 'description') {
                    $record->{$field} = '<p>' . implode('</p><p>', $generator->paragraphs(rand(2, 6))) . '</p>';
                } elseif ($meta['name'] == 'content') {
                    $record->{$field} = '<p>' . implode('</p><p>', $generator->paragraphs(rand(5, 15))) . '</p>';
                } else {
                    try {
                        $record->{$field} = $generator->{$field};
                        continue;
                    } catch (Throwable $e) {
                        ddd($meta);
                    }
                }
            }
        }

        return $record;
    }
234497
protected function loadData()
    {
        $this->loaded = true;

        $innerKey = $this->key(Record::INNER_KEY);
        if (empty($this->parent->getField($innerKey))) {
            //Unable to load
            return;
        }

        $selector = $this->orm->selector($this->getClass());
        $decorator = new AliasDecorator($selector, 'where', $selector->getAlias());
        $decorator->where($this->whereStatement());

        $this->data = $selector->fetchData();

        if (!empty($this->data[0])) {
            //Use first result
            $this->data = $this->data[0];
        }
    }
561922
private function loadByData(): Record
    {
        $this->_loaded = true;
        $this->_data = $this->_table->row('*', self::dataForWrite())->toArray();
        return $this;
    }
951680
public function fetchNextRow()
	{
		if( $this->cursor < $this->RecordCount() )
		{
			$this->cursor ++;
			$row = $this->rows[$this->cursor-1];
			return $row->getValues();
		}
		else return FALSE;
	}
608838
def populate_records(self):
        

        self.object_list = self.get_valuesqueryset(self.object_list)
        super(ValuesDatatable, self).populate_records()
352778
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('PD record already initialized!')

        self._initialized = True
        self.padding = b''
110550
def refresh(self, records):
        
        self._loaded = True
        
        if self.isLoading():
            return
        
        # load the information
        if RecordSet.typecheck(records):
            table = records.table()
            self.setTableType(table)
            
            if self.order():
                records.setOrder(self.order())
            
            # load specific data for this record box
            if self.specifiedColumnsOnly():
                records.setColumns(map(lambda x: x.name(),
                                       self.specifiedColumns()))
            
            # load the records asynchronously
            if self.isThreadEnabled() and table:
                try:
                    thread_enabled = table.getDatabase().isThreadEnabled()
                except AttributeError:
                    thread_enabled = False
                
                if thread_enabled:
                    # ensure we have a worker thread running
                    self.worker()
                    
                    # assign ordering based on tree table
                    if self.showTreePopup():
                        tree = self.treePopupWidget()
                        if tree.isSortingEnabled():
                            col = tree.sortColumn()
                            colname = tree.headerItem().text(col)
                            column = table.schema().column(colname)
                            
                            if column:
                                if tree.sortOrder() == Qt.AscendingOrder:
                                    sort_order = 'asc'
                                else:
                                    sort_order = 'desc'
                                
                                records.setOrder([(column.name(), sort_order)])
                    
                    self.loadRequested.emit(records)
                    return
        
        # load the records synchronously
        self.loadingStarted.emit()
        curr_record = self.currentRecord()
        self.blockSignals(True)
        self.setUpdatesEnabled(False)
        self.clear()
        use_dummy = not self.isRequired() or self.isCheckable()
        if use_dummy:
            self.addItem('')
        self.addRecords(records)
        self.setUpdatesEnabled(True)
        self.blockSignals(False)
        self.setCurrentRecord(curr_record)
        self.loadingFinished.emit()
42961
def create(self, method, uri, params=None, data=None, headers=None, auth=None, timeout=None,
               allow_redirects=False):
        
        response = self.request(
            method,
            uri,
            params=params,
            data=data,
            headers=headers,
            auth=auth,
            timeout=timeout,
            allow_redirects=allow_redirects,
        )

        if response.status_code < 200 or response.status_code >= 300:
            raise self.exception(method, uri, response, 'Unable to create record')

        return json.loads(response.text)
356658
def update_record(self, record, data=None, priority=None,
            ttl=None, comment=None):
        
        return self.manager.update_record(self, record, data=data,
            priority=priority, ttl=ttl, comment=comment)
151267
def _create_record(attribute_names = self.attribute_names)
      attribute_names = attributes_for_create(attribute_names)

      new_id = self.class._insert_record(
        attributes_with_values(attribute_names)
      )

      self.id ||= new_id if @primary_key

      @new_record = false

      yield(self) if block_given?

      id
    end
935465
def _get_record(self, name):
        """"""
        request = self._session.get(self._baseurl, params={'name': name,
                                                           'type': 'A'})
        if not request.ok:
            raise RuntimeError('Failed to search record: %s - %s' %
                               (self._format_hostname(name), request.json()))
        records = request.json()
        if len(records) == 0:
            return
        record = records[0]
        if 'record' not in record or 'id' not in record['record']:
            raise RuntimeError('Invalid record JSON format: %s - %s' %
                               (self._format_hostname(name), request.json()))
        return int(record['record']['id'])
9442
def addRecord(self, record):
        
        if self._destroyed:
            return
        
        if not self.uiRecordBTN.isChecked():
            return
        
        self._queue.append(record)