Bridge/Symfony/Serializer/Normalizer/AbstractAttachmentNormalizer.php
protected function normalizeAttachment(AttachmentInterface $attachment)
    {
        $formatter = $this->getFormatter();

        return [
            'id'           => $attachment->getId(),
            'title'        => $attachment->getTitle(),
            'type'         => $attachment->getType(),
            'size'         => $attachment->getSize(),
            'internal'     => $attachment->isInternal(),
            'file'         => pathinfo($attachment->getPath(), PATHINFO_BASENAME),
            'created_at'   => ($date = $attachment->getCreatedAt()) ? $date->format('Y-m-d H:i:s') : null,
            'f_created_at' => ($date = $attachment->getCreatedAt()) ? $formatter->dateTime($date) : null,
            'updated_at'   => ($date = $attachment->getUpdatedAt()) ? $date->format('Y-m-d H:i:s') : null,
            'f_updated_at' => ($date = $attachment->getUpdatedAt()) ? $formatter->dateTime($date) : null,
        ];
    }
protected function normalizeAttachment(AttachmentInterface $attachment)
    {
        $formatter = $this->getFormatter();

        return [
            'id'           => $attachment->getId(),
            'title'        => $attachment->getTitle(),
            'type'         => $attachment->getType(),
            'size'         => $attachment->getSize(),
            'internal'     => $attachment->isInternal(),
            'file'         => pathinfo($attachment->getPath(), PATHINFO_BASENAME),
            'created_at'   => ($date = $attachment->getCreatedAt()) ? $date->format('Y-m-d H:i:s') : null,
            'f_created_at' => ($date = $attachment->getCreatedAt()) ? $formatter->dateTime($date) : null,
            'updated_at'   => ($date = $attachment->getUpdatedAt()) ? $date->format('Y-m-d H:i:s') : null,
            'f_updated_at' => ($date = $attachment->getUpdatedAt()) ? $formatter->dateTime($date) : null,
        ];
    }
Normalizes the attachment.

@param AttachmentInterface $attachment

@return array