Doctrine\ODM\PHPCR\Mapping\ClassMetadata::getAssociation PHP 메소드

getAssociation() 공개 메소드

public getAssociation ( $fieldName ) : array
리턴 array the association mapping with the field of this name
    public function getAssociation($fieldName)
    {
        if (!$this->hasAssociation($fieldName)) {
            throw MappingException::associationNotFound($this->name, $fieldName);
        }
        return $this->mappings[$fieldName];
    }

Usage Example

예제 #1
0
 /**
  * @depends testClassName
  *
  * @expectedException \Doctrine\ODM\PHPCR\Mapping\MappingException
  */
 public function testGetAssociationNonexisting(ClassMetadata $cm)
 {
     $cm->getAssociation('nonexisting');
 }
ClassMetadata