Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

Problem in Datetime formatter. #12

@JamshadAhmad

Description

@JamshadAhmad

Hi,
We are using version 0.2.3

We are facing following error Catchable Fatal Error: Object of class DateTime could not be converted to string when we try to see logs for a user who has updated any DateTime related field.

If that can be fixed with some configuration changes or something, please do tell.


To fix that, We are trying to implement a custom formatter. But there is another weird problem.

Our customer formatter,
extends
ActivityLogBundle\Service\ActivityLog\EntityFormatter\AbstractFormatter
and implements
ActivityLogBundle\Service\ActivityLog\EntityFormatter\FormatterInterface

But we are having another error on function declaration line
public function format(LogEntryInterface $log)

error
Type error: Argument 1 passed to AppBundle\Service\LogFormatter\AccountRegistration::format() must implement interface ActivityLogBundle\Entity\LogEntryInterface, array given

We are using formatter like this in controller.

$logEntries =  $this
                ->getDoctrine()
                ->getManager()
                ->getRepository('ActivityLogBundle:LogEntry')
                ->findBy(['user' => $user], ['loggedAt' => 'DESC']);

            // formatting logs in a good readable view
            $formattedLogEntries[]  = $this
                ->get('app.formatter.account_registration')
                ->format($logEntries);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions