diff --git a/lib/Doctrine/ORM/Mapping/CustomIdGenerator.php b/lib/Doctrine/ORM/Mapping/CustomIdGenerator.php new file mode 100644 index 000000000..62d31a20c --- /dev/null +++ b/lib/Doctrine/ORM/Mapping/CustomIdGenerator.php @@ -0,0 +1,31 @@ +. + */ + +namespace Doctrine\ORM\Mapping; + +/** + * @Annotation + * @Target("PROPERTY") + */ +final class CustomIdGenerator implements Annotation { + /** @var string */ + public $class; + /** @var array */ + public $args; +} \ No newline at end of file diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php new file mode 100644 index 000000000..3ad0a0315 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.ORM.Mapping.Animal.php @@ -0,0 +1,30 @@ +setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE); +$metadata->setDiscriminatorColumn(array( + 'name' => 'dtype', + 'type' => 'string', + 'length' => 255, + 'fieldName' => 'dtype', + )); +$metadata->setDiscriminatorMap(array( + 'cat' => 'Doctrine\\Tests\\ORM\\Mapping\\Cat', + 'dog' => 'Doctrine\\Tests\\ORM\\Mapping\\Dog', + )); +$metadata->setChangeTrackingPolicy(ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT); +$metadata->mapField(array( + 'fieldName' => 'id', + 'type' => 'string', + 'length' => NULL, + 'precision' => 0, + 'scale' => 0, + 'nullable' => false, + 'unique' => false, + 'id' => true, + 'columnName' => 'id', + )); +$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_CUSTOM); +$metadata->setCustomGeneratorDefinition(array("class" => "stdClass", "args" => array("par1", "par2")));