From f4021e7469109588c69b13420707482982ba7cf0 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Mon, 16 May 2011 20:42:38 +0200 Subject: [PATCH] Update Doctrine Common to latest version and add new methods to ClassMetadataInfo --- .../ORM/Mapping/ClassMetadataInfo.php | 48 +++++++++++++++++++ lib/vendor/doctrine-common | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index f556257f9ed..eb686385944 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -1840,4 +1840,52 @@ public function markReadOnly() { $this->isReadOnly = true; } + + /** + * A numerically indexed list of field names of this persistent class. + * + * This array includes identifier fields if present on this class. + * + * @return array + */ + public function getFieldNames() + { + return array_keys($this->fieldMappings); + } + + /** + * A numerically indexed list of association names of this persistent class. + * + * This array includes identifier associations if present on this class. + * + * @return array + */ + public function getAssociationNames() + { + return array_keys($this->associationMappings); + } + + /** + * Returns the target class name of the given association. + * + * @param string $assocName + * @return string + */ + public function getAssociationTargetClass($assocName) + { + if (!isset($this->associationMappings[$assocName])) { + throw new \InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); + } + return $this->associationMappings[$assocName]['targetEntity']; + } + + /** + * Get fully-qualified class name of this persistent class. + * + * @return string + */ + public function getName() + { + return $this->name; + } } diff --git a/lib/vendor/doctrine-common b/lib/vendor/doctrine-common index ba63ae0f0b6..ea434bbea37 160000 --- a/lib/vendor/doctrine-common +++ b/lib/vendor/doctrine-common @@ -1 +1 @@ -Subproject commit ba63ae0f0b6b62a2a8617f01386698730ff2b713 +Subproject commit ea434bbea37e067aa52272816c6dcda5ff826154