Initialize from ASN.1.

@param Sequence $seq
517866
public static function fromASN1(Sequence $seq): self
    {
        $cert_id = null;
        $entity_name = null;
        $digest_info = null;
        if ($seq->hasTagged(0)) {
            $cert_id = IssuerSerial::fromASN1(
                $seq->getTagged(0)
                    ->asImplicit(Element::TYPE_SEQUENCE)
                    ->asSequence());
        }
        if ($seq->hasTagged(1)) {
            $entity_name = GeneralNames::fromASN1(
                $seq->getTagged(1)
                    ->asImplicit(Element::TYPE_SEQUENCE)
                    ->asSequence());
        }
        if ($seq->hasTagged(2)) {
            $digest_info = ObjectDigestInfo::fromASN1(
                $seq->getTagged(2)
                    ->asImplicit(Element::TYPE_SEQUENCE)
                    ->asSequence());
        }
        $obj = new self($cert_id, $entity_name);
        $obj->_objectDigestInfo = $digest_info;
        return $obj;
    }
881202
private function _lockSequence($sequence)
    {
        $result = $this->_connection->execute(
            "SELECT id FROM sequences WHERE name=? FOR UPDATE", $sequence);

        switch (count($result)) {
            case 0:
                // sequence not in table; insert and use startId value
                $this->_connection->execute(
                    "INSERT INTO sequences VALUES (?,?)",
                    $sequence, $this->_startId);
                $id = $this->_startId;
                break;

            case 1:
                // sequence already in table; remember its current ID
                $id = $result[0]['id'];
                break;

            default:
                // multiple rows for sequence; bad
                throw new \Pheasant\Exception("Multiple rows exist for sequence '$sequence'");
                break;
        }

        return $id;
    }
945902
protected final <R extends Request<T>> R setSequence(int sequence) {
        checkIfActive();
        this.sequence = sequence;
        return (R) this;
    }
59367
def set_query_sequence(self,seq):
    
    self._options = self._options.replace(query_sequence = seq)
672995
public static function fromASN1(Sequence $seq): self
    {
        $nb = $seq->at(0)
            ->asGeneralizedTime()
            ->dateTime();
        $na = $seq->at(1)
            ->asGeneralizedTime()
            ->dateTime();
        return new self($nb, $na);
    }
544744
public function dropAndCreateSequence(Sequence $sequence)
    {
        $this->tryMethod('dropSequence', $sequence->getQuotedName($this->_platform));
        $this->createSequence($sequence);
    }
874102
public static function fromASN1(Sequence $seq): self
    {
        $nb = Time::fromASN1($seq->at(0)->asTime());
        $na = Time::fromASN1($seq->at(1)->asTime());
        return new self($nb, $na);
    }
227401
protected function _addSequence(Sequence $sequence)
    {
        $namespaceName = $sequence->getNamespaceName();
        $seqName       = $sequence->getFullQualifiedName($this->getName());

        if (isset($this->_sequences[$seqName])) {
            throw SchemaException::sequenceAlreadyExists($seqName);
        }

        if ($namespaceName !== null
            && ! $sequence->isInDefaultNamespace($this->getName())
            && ! $this->hasNamespace($namespaceName)) {
            $this->createNamespace($namespaceName);
        }

        $this->_sequences[$seqName] = $sequence;
    }
33742
public static function fromASN1(Sequence $seq): self
    {
        $org = DisplayText::fromASN1($seq->at(0)->asString());
        $numbers = array_map(
            function (UnspecifiedType $el) {
                return $el->asInteger()->intNumber();
            },
            $seq->at(1)
                ->asSequence()
                ->elements());
        return new self($org, ...$numbers);
    }
772805
public void setCommandSequence(long sequence) {
    // For each increment of the sequence number, trigger query callbacks that are dependent on the specific sequence.
    for (long i = commandSequence + 1; i <= sequence; i++) {
      commandSequence = i;
      List<Runnable> queries = this.sequenceQueries.remove(commandSequence);
      if (queries != null) {
        for (Runnable query : queries) {
          query.run();
        }
      }
    }
  }
878945
public function toASN1(): Sequence
    {
        $elements = array_values(
            array_map(
                function ($ext) {
                    return $ext->toASN1();
                }, $this->_extensions));
        return new Sequence(...$elements);
    }
388611
function CreateSequence($seqname = 'adodbseq', $start = 1)
  {
                $res =  $this->Execute("CREATE TABLE $seqname ( ID autoinc( 1 ) ) IN DATABASE");
                if(!$res){
                        print $this->ErrorMsg();
                        return false;
                }
                else
                        return true;

        }
1127558
private static function _createOracleSequence()
    {
        $name = self::resolveSequenceName();
        $sql  = "create sequence $name increment by 1 start with 1 nocycle nocache";
        Log::log($sql);
        $stmt = self::query($sql);
        self::closeCursor($stmt);
    }
1035781
public static function fromASN1(Sequence $seq): self
    {
        $type = AttributeType::fromASN1($seq->at(0)->asObjectIdentifier());
        $values = array_map(
            function (UnspecifiedType $el) use ($type) {
                return AttributeValue::fromASN1ByOID($type->oid(), $el);
            }, $seq->at(1)
                ->asSet()
                ->elements());
        return new self($type, ...$values);
    }
1228603
public void setInitialSequence(int[] sequence) {
    if(models != null){
      for(int i = 0; i < models.length; i++)
        models[i].setInitialSequence(sequence);
      return;
    }
    model1.setInitialSequence(sequence);
    model2.setInitialSequence(sequence);
  }
1278460
public function toASN1(): Sequence
    {
        $elements = array_map(
            function (Attribute $attr) {
                return $attr->toASN1();
            }, array_values($this->_attributes));
        return new Sequence(...$elements);
    }
758967
public function setSequences(array $sequences)
    {
        $this->sequences = array();

        foreach ($sequences as $sequence) {
            $this->addSequence($sequence);
        }
    }