Initialize from ASN.1.

@param Sequence $seq
@return self
557671
public static function fromASN1(Sequence $seq): self
    {
        $base = GeneralName::fromASN1($seq->at(0)->asTagged());
        $min = 0;
        $max = null;
        if ($seq->hasTagged(0)) {
            $min = $seq->getTagged(0)
                ->asImplicit(Element::TYPE_INTEGER)
                ->asInteger()
                ->intNumber();
        }
        if ($seq->hasTagged(1)) {
            $max = $seq->getTagged(1)
                ->asImplicit(Element::TYPE_INTEGER)
                ->asInteger()
                ->intNumber();
        }
        return new self($base, $min, $max);
    }
1278460
public function toASN1(): Sequence
    {
        $elements = array_map(
            function (Attribute $attr) {
                return $attr->toASN1();
            }, array_values($this->_attributes));
        return new Sequence(...$elements);
    }
1266734
public static function fromASN1(Sequence $seq): self
    {
        $tbsCert = TBSCertificate::fromASN1($seq->at(0)->asSequence());
        $algo = AlgorithmIdentifier::fromASN1($seq->at(1)->asSequence());
        if (!$algo instanceof SignatureAlgorithmIdentifier) {
            throw new \UnexpectedValueException(
                "Unsupported signature algorithm " . $algo->oid() . ".");
        }
        $signature = Signature::fromSignatureData(
            $seq->at(2)
                ->asBitString()
                ->string(), $algo);
        return new self($tbsCert, $algo, $signature);
    }
1187013
public function setSequenceGenerator($sequenceName, $allocationSize = 1, $initialValue = 1)
    {
        $this->sequenceDef = array(
            'sequenceName' => $sequenceName,
            'allocationSize' => $allocationSize,
            'initialValue' => $initialValue,
        );
        return $this;
    }
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;

        }
1254471
function GenID2012($seq='adodbseq',$start=1)
	{

		/*
		 * First time in create an array of sequence names that we
		 * can use in later requests to see if the sequence exists
		 * the overhead is creating a list of sequences every time
		 * we need access to at least 1. If we really care about
		 * performance, we could maybe flag a 'nocheck' class variable
		 */
		if (!$this->sequences){
			$sql = "SELECT name FROM sys.sequences";
			$this->sequences = $this->GetCol($sql);
		}
		if (!is_array($this->sequences)
		|| is_array($this->sequences) && !in_array($seq,$this->sequences)){
			$this->CreateSequence2012($seq, $start);

		}
		$num = $this->GetOne("SELECT NEXT VALUE FOR $seq");
		return $num;
	}
447267
public function asSequence(): Constructed\Sequence
    {
        if (!$this->_element instanceof Constructed\Sequence) {
            throw new \UnexpectedValueException(
                $this->_generateExceptionMessage(Element::TYPE_SEQUENCE));
        }
        return $this->_element;
    }
884414
public function toASN1(): Sequence
    {
        $elements = array(new Enumerated($this->_digestedObjectType));
        if (isset($this->_otherObjectTypeID)) {
            $elements[] = new ObjectIdentifier($this->_otherObjectTypeID);
        }
        $elements[] = $this->_digestAlgorithm->toASN1();
        $elements[] = $this->_objectDigest;
        return new Sequence(...$elements);
    }
713156
function CreateSequence2008($seq='adodbseq',$start=1)
	{
		if($this->debug) ADOConnection::outp("<hr>CreateSequence($seq,$start)");
		sqlsrv_begin_transaction($this->_connectionID);
		$start -= 1;
		$this->Execute("create table $seq (id int)");//was float(53)
		$ok = $this->Execute("insert into $seq with (tablock,holdlock) values($start)");
		if (!$ok) {
			if($this->debug) ADOConnection::outp("<hr>Error: ROLLBACK");
			sqlsrv_rollback($this->_connectionID);
			return false;
		}
		sqlsrv_commit($this->_connectionID);
		return true;
	}
260153
private void addSequence(String sequenceName, HighLowSequence seq)
    {
        // lookup the sequence map for calling DB
        String jcdAlias = getBrokerForClass()
                .serviceConnectionManager().getConnectionDescriptor().getJcdAlias();
        Map mapForDB = (Map) sequencesDBMap.get(jcdAlias);
        if(mapForDB == null)
        {
            mapForDB = new HashMap();
        }
        mapForDB.put(sequenceName, seq);
        sequencesDBMap.put(jcdAlias, mapForDB);
    }
1067046
function setSequenceGenerator(\Tecnocreaciones\Bundle\ToolsBundle\Service\SequenceGenerator $sequenceGenerator) {
        $this->sequenceGenerator = $sequenceGenerator;
    }
29939
@Override
    public Object mapSequence(Object sequence) {
        List<?> seq = (List<?>) sequence;
        List<Object> out = new ArrayList<>();
        for (Object step : seq) {
            out.add(map(step));
        }
        return out;
    }
1137705
public function toASN1(): Sequence
    {
        return new Sequence($this->_acinfo->toASN1(),
            $this->_signatureAlgorithm->toASN1(),
            $this->_signatureValue->bitString());
    }
137265
public function toASN1(): Sequence
    {
        return new Sequence(new Integer(0), new Integer($this->_modulus),
            new Integer($this->_publicExponent),
            new Integer($this->_privateExponent), new Integer($this->_prime1),
            new Integer($this->_prime2), new Integer($this->_exponent1),
            new Integer($this->_exponent2), new Integer($this->_coefficient));
    }
782881
public function createSequence($sequence)
    {
        $changeSetElt = $this->createChangeSet('create-sequence-' . $sequence->getName());

        $sequenceName = QualifiedName::fromAsset($sequence);
        $createSequenceElt = $this->document->createElement('createSequence');

        if ($sequenceName->getNamespaceName()) {
            $createSequenceElt->setAttribute('schemaName', $sequenceName->getNamespaceName());
        }
        $createSequenceElt->setAttribute('sequenceName', $sequenceName->getName());
        $createSequenceElt->setAttribute('startValue', $sequence->getInitialValue());

        $changeSetElt->appendChild($createSequenceElt);
        $this->root->appendChild($changeSetElt);
    }
516809
function iterateSequence()
    {
        if ( !$this->hasSequence() )
            return;

        $fName    = $this->Name;
        $uniqid   = $this->UniqID;
        $seqArray = "${fName}_sequence_array_$uniqid";
        $seqVar   = "${fName}_sequence_var_$uniqid";
        $alterSeqValCode =
            "if ( ( \$$seqVar = next( \$$seqArray ) ) === false )\n" .
            "{\n" .
            "   reset( \$$seqArray );\n" .
            "   \$$seqVar = current( \$$seqArray );\n" .
            "}\n";
        $this->NewNodes[] = eZTemplateNodeTool::createCodePieceNode( "// sequence iteration" );
        $this->NewNodes[] = eZTemplateNodeTool::createCodePieceNode( $alterSeqValCode );
    }
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);
    }