From cd728344e96281a51afba6a4eb22f4e0058757f0 Mon Sep 17 00:00:00 2001 From: Guido Contreras Woda Date: Tue, 23 Dec 2014 09:48:02 -0300 Subject: [PATCH] Allow an association to be set as primary key through the builder --- .../ORM/Mapping/Builder/AssociationBuilder.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php index 942a662e4..2536f5be6 100644 --- a/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php +++ b/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php @@ -183,6 +183,17 @@ class AssociationBuilder return $this; } + /** + * Sets field as primary key. + * + * @return AssociationBuilder + */ + public function isPrimaryKey() + { + $this->mapping['id'] = true; + return $this; + } + /** * @return ClassMetadataBuilder *