/** {@inheritdoc} */ public function getAssociationValue($object, $fieldName) { if (!$this->hasAssociation($fieldName)) { throw new MetadataException("Association '{$fieldName}' not found in class '{$this->getClass()}'."); } if ($this->classMetadata->isSingleValuedAssociation($fieldName)) { $value = $this->classMetadata->getFieldValue($object, $fieldName); } else { $value = $this->getCollection($object, $fieldName); } return $value; }
/** * {@inheritdoc} */ public function isSingleValuedAssociation($fieldName) { return $this->classMetadata->isSingleValuedAssociation($fieldName); }