Пример #1
0
 /** {@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;
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function isSingleValuedAssociation($fieldName)
 {
     return $this->classMetadata->isSingleValuedAssociation($fieldName);
 }