1
0
mirror of synced 2024-12-13 22:56:04 +03:00

Update Doctrine Common to latest version and add new methods to ClassMetadataInfo

This commit is contained in:
Benjamin Eberlei 2011-05-16 20:42:38 +02:00
parent 5d81e867be
commit f4021e7469
2 changed files with 49 additions and 1 deletions

View File

@ -1840,4 +1840,52 @@ class ClassMetadataInfo implements ClassMetadata
{
$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;
}
}

@ -1 +1 @@
Subproject commit ba63ae0f0b6b62a2a8617f01386698730ff2b713
Subproject commit ea434bbea37e067aa52272816c6dcda5ff826154