abstract class IdGenerator (View source)

Used to abstract ID generation.

Methods

static IdGenerator
create(int $generatorType)

Factory method for the predefined strategies.

string
generate(object $document, ClassMetadata $class, DocumentManagerInterface $dm, object $parent = null)

Generate the actual id, to be overwritten by extending classes.

Details

static IdGenerator create(int $generatorType)

Factory method for the predefined strategies.

Parameters

int $generatorType

Return Value

IdGenerator

abstract string generate(object $document, ClassMetadata $class, DocumentManagerInterface $dm, object $parent = null)

Generate the actual id, to be overwritten by extending classes.

Parameters

object $document the object to create the id for
ClassMetadata $class class metadata of this object
DocumentManagerInterface $dm
object $parent

Return Value

string the id for this document