class ParentIdGenerator extends IdGenerator (View source)

Generate the id from the nodename and the parent mapping fields. Simply uses the parent id and appends the nodename field.

Methods

static IdGenerator
create(int $generatorType)

Factory method for the predefined strategies.

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

Use the name and parent fields to generate the id.

buildName($document, ClassMetadata $class, DocumentManagerInterface $dm, $parent, $name)

No description

Details

static IdGenerator create(int $generatorType)

Factory method for the predefined strategies.

Parameters

int $generatorType

Return Value

IdGenerator

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

Use the name and parent fields to generate the id.

{@inheritdoc}

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

protected buildName($document, ClassMetadata $class, DocumentManagerInterface $dm, $parent, $name)

Parameters

$document
ClassMetadata $class
DocumentManagerInterface $dm
$parent
$name