Sequence
- Type
- Class
- Namespace
- craft\helpers
- Inherits
- craft\helpers\Sequence
- Since
- 3.0.31
Class Sequence
View source (opens new window)
# Public Methods
Method | Description |
---|---|
current() | Returns the current value in a given sequence. |
next() | Returns the next number in a given sequence. |
# current()
- Since
- 3.0.32
Returns the current value in a given sequence.
View source (opens new window)
Arguments
$name
(string (opens new window)) – The sequence name.$length
(integer (opens new window), null (opens new window)) – The minimum string length that should be returned. (Numbers that are too short will be left-padded with0
s.)
Returns
integer (opens new window), string (opens new window)
# next()
Returns the next number in a given sequence.
View source (opens new window)
Arguments
$name
(string (opens new window)) – The sequence name.$length
(integer (opens new window), null (opens new window)) – The minimum string length that should be returned. (Numbers that are too short will be left-padded with0
s.)
Returns
integer (opens new window), string (opens new window)
Throws
- yii\db\Exception (opens new window)
if a lock could not be acquired for the sequence - Throwable (opens new window)
if reasons