lib/Doctrine/ORM/Mapping/ClassMetadata.php
public function getIdentifierColumns(EntityManagerInterface $em) : array
    {
        $columns = [];

        foreach ($this->identifier as $idProperty) {
            $property = $this->getProperty($idProperty);

            if ($property instanceof FieldMetadata) {
                $columns[$property->getColumnName()] = $property;

                continue;
            }

            /** @var AssociationMetadata $property */

            // Association defined as Id field
            $targetClass = $em->getClassMetadata($property->getTargetEntity());

            if (! $property->isOwningSide()) {
                $property    = $targetClass->getProperty($property->getMappedBy());
                $targetClass = $em->getClassMetadata($property->getTargetEntity());
            }

            $joinColumns = $property instanceof ManyToManyAssociationMetadata
                ? $property->getJoinTable()->getInverseJoinColumns()
                : $property->getJoinColumns();

            foreach ($joinColumns as $joinColumn) {
                /** @var JoinColumnMetadata $joinColumn */
                $columnName           = $joinColumn->getColumnName();
                $referencedColumnName = $joinColumn->getReferencedColumnName();

                if (! $joinColumn->getType()) {
                    $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em));
                }

                $columns[$columnName] = $joinColumn;
            }
        }

        return $columns;
    }
public function getIdentifierColumns(EntityManagerInterface $em) : array
    {
        $columns = [];

        foreach ($this->identifier as $idProperty) {
            $property = $this->getProperty($idProperty);

            if ($property instanceof FieldMetadata) {
                $columns[$property->getColumnName()] = $property;

                continue;
            }

            /** @var AssociationMetadata $property */

            // Association defined as Id field
            $targetClass = $em->getClassMetadata($property->getTargetEntity());

            if (! $property->isOwningSide()) {
                $property    = $targetClass->getProperty($property->getMappedBy());
                $targetClass = $em->getClassMetadata($property->getTargetEntity());
            }

            $joinColumns = $property instanceof ManyToManyAssociationMetadata
                ? $property->getJoinTable()->getInverseJoinColumns()
                : $property->getJoinColumns();

            foreach ($joinColumns as $joinColumn) {
                /** @var JoinColumnMetadata $joinColumn */
                $columnName           = $joinColumn->getColumnName();
                $referencedColumnName = $joinColumn->getReferencedColumnName();

                if (! $joinColumn->getType()) {
                    $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em));
                }

                $columns[$columnName] = $joinColumn;
            }
        }

        return $columns;
    }
public function getIdentifierColumns ( EntityManagerInterface $ em ) : array { $ columns = [ ] ; foreach ( $ this -> identifier as $ idProperty ) { $ property = $ this -> getProperty ( $ idProperty ) ; if ( $ property instanceof FieldMetadata ) { $ columns [ $ property -> getColumnName ( ) ] = $ property ; continue ; } /** @var AssociationMetadata $property */ // Association defined as Id field $ targetClass = $ em -> getClassMetadata ( $ property -> getTargetEntity ( ) ) ; if ( ! $ property -> isOwningSide ( ) ) { $ property = $ targetClass -> getProperty ( $ property -> getMappedBy ( ) ) ; $ targetClass = $ em -> getClassMetadata ( $ property -> getTargetEntity ( ) ) ; } $ joinColumns = $ property instanceof ManyToManyAssociationMetadata ? $ property -> getJoinTable ( ) -> getInverseJoinColumns ( ) : $ property -> getJoinColumns ( ) ; foreach ( $ joinColumns as $ joinColumn ) { /** @var JoinColumnMetadata $joinColumn */ $ columnName = $ joinColumn -> getColumnName ( ) ; $ referencedColumnName = $ joinColumn -> getReferencedColumnName ( ) ; if ( ! $ joinColumn -> getType ( ) ) { $ joinColumn -> setType ( PersisterHelper :: getTypeOfColumn ( $ referencedColumnName , $ targetClass , $ em ) ) ; } $ columns [ $ columnName ] = $ joinColumn ; } } return $ columns ; }
Returns an array with identifier column names and their corresponding ColumnMetadata.

@return ColumnMetadata[]
Returns an array with identifier column names and their corresponding ColumnMetadata .