LeKoala\Uuid\UuidExtension
Synopsis
class UuidExtension
extends DataExtension
{
- // constants
- const UUID_BINARY_FORMAT = 'binary';
- const UUID_STRING_FORMAT = 'string';
- const UUID_BASE62_FORMAT = 'base62';
- // members
- private static array $db = ;
- // methods
- public string assignNewUuid()
- public static DataObject|false getByUuid()
- public static string getUuidFormat()
- public string UuidSegment()
- public void onBeforeWrite()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Constants
Name | Value |
---|---|
UUID_BINARY_FORMAT | 'binary' |
UUID_STRING_FORMAT | 'string' |
UUID_BASE62_FORMAT | 'base62' |
Members
private
- $db
Methods
public
- UuidSegment() — Return a uuid suitable for an URL, like an URLSegment
- assignNewUuid() — Assign a new uuid to this record. This will overwrite any existing uuid.
- getByUuid() — Get a record by its uuid
- getUuidFormat() — Guess uuid format based on strlen
- onBeforeWrite()