PartKeepr\DoctrineReflectionBundle\Services\ReflectionService::getByReferenceMappings PHP Method

getByReferenceMappings() protected method

Returns all by-reference associations.
protected getByReferenceMappings ( Doctrine\ORM\Mapping\ClassMetadata $cm ) : array
$cm Doctrine\ORM\Mapping\ClassMetadata
return array
    protected function getByReferenceMappings(ClassMetadata $cm)
    {
        $byReferenceMappings = [];
        foreach ($cm->getReflectionClass()->getProperties() as $property) {
            $byReferenceAnnotation = $this->reader->getPropertyAnnotation($property, 'PartKeepr\\DoctrineReflectionBundle\\Annotation\\ByReference');
            if ($byReferenceAnnotation !== null) {
                $byReferenceMappings[] = $property->getName();
            }
        }
        return $byReferenceMappings;
    }