public function handleExcludeField(EventInterface $event)
    {
        /** @var \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata */
        $metadata    = $event->getParam('metadata');
        $identifiers = $metadata->getIdentifierFieldNames();

        return in_array($event->getParam('name'), $identifiers) &&
               ($metadata->generatorType === ClassMetadata::GENERATOR_TYPE_IDENTITY ||
                $metadata->generatorType === ClassMetadata::GENERATOR_TYPE_CUSTOM);
    }
public function handleExcludeField(EventInterface $event)
    {
        /** @var \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata */
        $metadata    = $event->getParam('metadata');
        $identifiers = $metadata->getIdentifierFieldNames();

        return in_array($event->getParam('name'), $identifiers) &&
               ($metadata->generatorType === ClassMetadata::GENERATOR_TYPE_IDENTITY ||
                $metadata->generatorType === ClassMetadata::GENERATOR_TYPE_CUSTOM);
    }
public function handleExcludeField ( EventInterface $ event ) { /** @var \Doctrine\ORM\Mapping\ClassMetadataInfo $metadata */ $ metadata = $ event -> getParam ( 'metadata' ) ; $ identifiers = $ metadata -> getIdentifierFieldNames ( ) ; return in_array ( $ event -> getParam ( 'name' ) , $ identifiers ) && ( $ metadata -> generatorType === ClassMetadata :: GENERATOR_TYPE_IDENTITY || $ metadata -> generatorType === ClassMetadata :: GENERATOR_TYPE_CUSTOM ) ; }
Exclude GENERATOR_TYPE_IDENTITY && GENERATOR_TYPE_CUSTOM
Because most of the time they are custom auto-incrementers

@param  EventInterface $event
@internal
@return bool
Exclude GENERATOR_TYPE_IDENTITY && GENERATOR_TYPE_CUSTOM Because most of the time they are custom auto - incrementers