public static function duplicateEntity(DuplicateEntity $event)
    {
        if ($event->getWithoutKeys()) {
            $entity = $event->getEntity();

            if (isset($GLOBALS['TL_DCA'][$entity->entityTableName()]['fields'])) {
                /** @var EntityAccessor $entityAccessor */
                $entityAccessor = $GLOBALS['container']['doctrine.orm.entityAccessor'];

                $fields = (array) $GLOBALS['TL_DCA'][$entity->entityTableName()]['fields'];
                foreach ($fields as $field => $fieldConfig) {
                    if (isset($fieldConfig['field']['timestampable'])) {
                        $entityAccessor->setRawProperty($entity, $field, null);
                    }
                }
            }
        }
    }
public static function duplicateEntity(DuplicateEntity $event)
    {
        if ($event->getWithoutKeys()) {
            $entity = $event->getEntity();

            if (isset($GLOBALS['TL_DCA'][$entity->entityTableName()]['fields'])) {
                /** @var EntityAccessor $entityAccessor */
                $entityAccessor = $GLOBALS['container']['doctrine.orm.entityAccessor'];

                $fields = (array) $GLOBALS['TL_DCA'][$entity->entityTableName()]['fields'];
                foreach ($fields as $field => $fieldConfig) {
                    if (isset($fieldConfig['field']['timestampable'])) {
                        $entityAccessor->setRawProperty($entity, $field, null);
                    }
                }
            }
        }
    }
public static function duplicateEntity ( DuplicateEntity $ event ) { if ( $ event -> getWithoutKeys ( ) ) { $ entity = $ event -> getEntity ( ) ; if ( isset ( $ GLOBALS [ 'TL_DCA' ] [ $ entity -> entityTableName ( ) ] [ 'fields' ] ) ) { /** @var EntityAccessor $entityAccessor */ $ entityAccessor = $ GLOBALS [ 'container' ] [ 'doctrine.orm.entityAccessor' ] ; $ fields = ( array ) $ GLOBALS [ 'TL_DCA' ] [ $ entity -> entityTableName ( ) ] [ 'fields' ] ; foreach ( $ fields as $ field => $ fieldConfig ) { if ( isset ( $ fieldConfig [ 'field' ] [ 'timestampable' ] ) ) { $ entityAccessor -> setRawProperty ( $ entity , $ field , null ) ; } } } } }
Clean timestamp able entries from duplicated entities.

@param DuplicateEntity $event The event.

@return void

@SuppressWarnings(PHPMD.Superglobals)
Clean timestamp able entries from duplicated entities .