Repaginate, update DB and slots object
@param int $nextslotnumber
@param int $type repaginate::LINK or repaginate::UNLINK.
509165
public function repaginate_slots($nextslotnumber, $type) {
        global $DB;
        $this->slots = $DB->get_records('quiz_slots', array('quizid' => $this->quizid), 'slot');
        $nextslot = null;
        $newslots = array();
        foreach ($this->slots as $slot) {
            if ($slot->slot < $nextslotnumber) {
                $newslots[$slot->id] = $slot;
            } else if ($slot->slot == $nextslotnumber) {
                $nextslot = $this->repaginate_next_slot($nextslotnumber, $type);

                // Update DB.
                $DB->update_record('quiz_slots', $nextslot, true);

                // Update returning object.
                $newslots[$slot->id] = $nextslot;
            }
        }
        if ($nextslot) {
            $newslots = array_merge($newslots, $this->repaginate_the_rest($this->slots, $nextslotnumber, $type));
            $this->slots = $this->get_slots_by_slotid($newslots);
        }
    }
1259859
public function remove($key, $value, $type = null)
	{
		if (is_null($type)) $type = $this->type($key);

		switch ($type)
		{
			case 'list':
				$key    = str_replace(':queued', '', $key);
				$random = Str::quickRandom(64);

				$this->database->lset($key, $value, $random);

				return $this->database->lrem($key, 1, $random);

			case 'zset':
				return $this->database->zrem($key, $value);

			default:
				throw new UnexpectedValueException("Unable to delete {$value} from {$key}. List type {$type} not supported.");
		}
	}
106273
public static function toManyRelationship(string $type, RuleInterface $next = null): RuleInterface
    {
        $primary = new ToManyRelationshipTypeCheckerRule($type);

        return $next === null ? $primary : new AndOperator($primary, $next);
    }
600913
public function skipUntil(int $type): void
    {
        while (!$this->current->typeEquals($type) && !$this->current->typeEquals(Token::T_EOI)) {
            $this->next();
        }
    }
339630
protected function shouldRemoveRules($key, XType $type)
    {

        if ($type instanceof SequenceType) {
            return true;
        }

        if ($type->isComplex()) {
            return true;
        }

        return false;
    }
1040290
public function nextTokenIf($type, $value = null)
    {
        if ($this->next->test($type, $value)) {
            return $this->next();
        }

        return false;
    }
203603
public function setNext($next)
    {
        $this->_links[self::NEXT][self::HREF] = $next;
        $this->removeEmptyLinks();

        return $this;
    }
36267
public function fetch($type = parent::FETCH_TYPE_NUM)
    {
        $callback = $this->_callback;
        $row = $this->_statement->fetch($type);

        return $row === false ? $row : $callback($row);
    }
41540
public function ToString($Type = 'more') {
      if ($this->_PropertiesDefined === FALSE)
         trigger_error(ErrorMessage('You must configure the pager with $Pager->Configure() before retrieving the pager.', 'MorePager', 'GetSimple'), E_USER_ERROR);
      
      // Urls with url-encoded characters will break sprintf, so we need to convert them for backwards compatibility.
      $this->Url = str_replace(array('%1$s', '%2$s', '%s'), array('{Offset}', '{Size}', '{Offset}'), $this->Url);

      $Pager = '';
      if ($Type == 'more') {
         $ClientID = $this->ClientID == '' ? '' : $this->ClientID . 'More';
         if ($this->Offset + $this->Limit >= $this->TotalRecords) {
            $Pager = ''; // $this->Offset .' + '. $this->Limit .' >= '. $this->TotalRecords;
         } else {
            $ActualRecordsLeft = $RecordsLeft = $this->TotalRecords - $this->_LastOffset;
            if ($RecordsLeft > $this->Limit)
               $RecordsLeft = $this->Limit;
               
            $NextOffset = $this->Offset + $this->Limit;

            $Pager .= Anchor(
               sprintf(T($this->MoreCode), $ActualRecordsLeft),
               self::FormatUrl($this->Url, $NextOffset, $this->Limit),
               '',
               array('rel' => 'nofollow')
            );
         }
      } else if ($Type == 'less') {
         $ClientID = $this->ClientID == '' ? '' : $this->ClientID . 'Less';
         if ($this->Offset <= 0) {
            $Pager = '';
         } else {
            $RecordsBefore = $this->Offset;
            if ($RecordsBefore > $this->Limit)
               $RecordsBefore = $this->Limit;
               
            $PreviousOffset = $this->Offset - $this->Limit;
            if ($PreviousOffset < 0)
               $PreviousOffset = 0;
               
            $Pager .= Anchor(
               sprintf(T($this->LessCode), $this->Offset),
               self::FormatUrl($this->Url, $PreviousOffset, $RecordsBefore),
               '',
               array('rel' => 'nofollow')
            );
         }
      }
      if ($Pager == '')
         return $this->PagerEmpty;
      else
         return sprintf($this->Wrapper, Attribute(array('id' => $ClientID, 'class' => $this->CssClass)), $Pager);
   }
816969
function(type) {
		new edb.Crawler().crawl(type, {
			ontype: function(t) {
				if (!t.$destructed) {
					type.ondestruct();
					type.$ondestruct();
					type.$destructed = true;
					if (!gui.unloading) {
						gui.GreatSpirit.$nukeallofit(type);
					}
				}
			}
		});
	}
50903
public function setRedirectType($type) {
        if (!is_int($type)) throw new IllegalTypeException('Illegal type of parameter $type: '.gettype($type));

        $this->redirectType = $type;
        return $this;
    }
330581
function nextCell( $colSpan = false )
    {
        $this->DocumentStack[$this->CurrentStackNumber]['CurrentCell'] += 1;
        if ( $colSpan != false )
            $this->DocumentStack[$this->CurrentStackNumber]['CurrentColSpan'] = $colSpan;
        else
            unset( $this->DocumentStack[$this->CurrentStackNumber]['CurrentColSpan'] );
    }
205766
public Annotation next(@NonNull AnnotationType type) {
      return document() == null ? Fragments.detachedEmptyAnnotation() : document().getAnnotationSet().next(this, type);
   }
850648
public function stepCreateRecordWithTable($type, $id, $null, TableNode $fieldsTable) {
		$class = $this->convertTypeToClass($type);
		// TODO Support more than one record
		$fields = $this->convertFields($class, $fieldsTable->getRowsHash());
		$fields = $this->prepareFixture($class, $id, $fields);

		// We should check if this fixture object already exists - if it does, we update it. If not, we create it
		if($existingFixture = $this->fixtureFactory->get($class, $id)) {
			// Merge existing data with new data, and create new object to replace existing object
			foreach($fields as $k => $v) {
				$existingFixture->$k = $v;
			}
			$existingFixture->write();
		} else {
			$this->fixtureFactory->createObject($class, $id, $fields);
		}
	}
1008349
public function skipUntil($type) {
    while (!$this->isToken($type) && $this->hasNext()) {
      $this->moveNext();
    }

    return $this;
  }
1006770
public function join($table, $type = NULL)
	{
		$this->_join[] = $this->_last_join = new \Database_Query_Builder_Join($table, $type);

		return $this;
	}
672903
public function getReplacementUrls($type)
    {
        $replacementUrls = array_map(function ($a1) use ($type) {
            return array_map(function ($a2) use ($type) {
                return $a2[$type];
            }, $a1);
        }, $this->replacementUrls);

        return $replacementUrls;
    }