Chris@0: . Chris@0: */ Chris@0: Chris@0: namespace Doctrine\Common\Persistence\Mapping; Chris@0: Chris@0: /** Chris@0: * Contract for a Doctrine persistence layer ClassMetadata class to implement. Chris@0: * Chris@0: * @link www.doctrine-project.org Chris@0: * @since 2.1 Chris@0: * @author Benjamin Eberlei Chris@0: * @author Jonathan Wage Chris@0: */ Chris@0: interface ClassMetadata Chris@0: { Chris@0: /** Chris@0: * Gets the fully-qualified class name of this persistent class. Chris@0: * Chris@0: * @return string Chris@0: */ Chris@0: public function getName(); Chris@0: Chris@0: /** Chris@0: * Gets the mapped identifier field name. Chris@0: * Chris@0: * The returned structure is an array of the identifier field names. Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function getIdentifier(); Chris@0: Chris@0: /** Chris@0: * Gets the ReflectionClass instance for this mapped class. Chris@0: * Chris@0: * @return \ReflectionClass Chris@0: */ Chris@0: public function getReflectionClass(); Chris@0: Chris@0: /** Chris@0: * Checks if the given field name is a mapped identifier for this class. Chris@0: * Chris@0: * @param string $fieldName Chris@0: * Chris@0: * @return boolean Chris@0: */ Chris@0: public function isIdentifier($fieldName); Chris@0: Chris@0: /** Chris@0: * Checks if the given field is a mapped property for this class. Chris@0: * Chris@0: * @param string $fieldName Chris@0: * Chris@0: * @return boolean Chris@0: */ Chris@0: public function hasField($fieldName); Chris@0: Chris@0: /** Chris@0: * Checks if the given field is a mapped association for this class. Chris@0: * Chris@0: * @param string $fieldName Chris@0: * Chris@0: * @return boolean Chris@0: */ Chris@0: public function hasAssociation($fieldName); Chris@0: Chris@0: /** Chris@0: * Checks if the given field is a mapped single valued association for this class. Chris@0: * Chris@0: * @param string $fieldName Chris@0: * Chris@0: * @return boolean Chris@0: */ Chris@0: public function isSingleValuedAssociation($fieldName); Chris@0: Chris@0: /** Chris@0: * Checks if the given field is a mapped collection valued association for this class. Chris@0: * Chris@0: * @param string $fieldName Chris@0: * Chris@0: * @return boolean Chris@0: */ Chris@0: public function isCollectionValuedAssociation($fieldName); Chris@0: Chris@0: /** Chris@0: * A numerically indexed list of field names of this persistent class. Chris@0: * Chris@0: * This array includes identifier fields if present on this class. Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function getFieldNames(); Chris@0: Chris@0: /** Chris@0: * Returns an array of identifier field names numerically indexed. Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function getIdentifierFieldNames(); Chris@0: Chris@0: /** Chris@0: * Returns a numerically indexed list of association names of this persistent class. Chris@0: * Chris@0: * This array includes identifier associations if present on this class. Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function getAssociationNames(); Chris@0: Chris@0: /** Chris@0: * Returns a type name of this field. Chris@0: * Chris@0: * This type names can be implementation specific but should at least include the php types: Chris@0: * integer, string, boolean, float/double, datetime. Chris@0: * Chris@0: * @param string $fieldName Chris@0: * Chris@0: * @return string Chris@0: */ Chris@0: public function getTypeOfField($fieldName); Chris@0: Chris@0: /** Chris@0: * Returns the target class name of the given association. Chris@0: * Chris@0: * @param string $assocName Chris@0: * Chris@0: * @return string Chris@0: */ Chris@0: public function getAssociationTargetClass($assocName); Chris@0: Chris@0: /** Chris@0: * Checks if the association is the inverse side of a bidirectional association. Chris@0: * Chris@0: * @param string $assocName Chris@0: * Chris@0: * @return boolean Chris@0: */ Chris@0: public function isAssociationInverseSide($assocName); Chris@0: Chris@0: /** Chris@0: * Returns the target field of the owning side of the association. Chris@0: * Chris@0: * @param string $assocName Chris@0: * Chris@0: * @return string Chris@0: */ Chris@0: public function getAssociationMappedByTargetField($assocName); Chris@0: Chris@0: /** Chris@0: * Returns the identifier of this object as an array with field name as key. Chris@0: * Chris@0: * Has to return an empty array if no identifier isset. Chris@0: * Chris@0: * @param object $object Chris@0: * Chris@0: * @return array Chris@0: */ Chris@0: public function getIdentifierValues($object); Chris@0: }