Skip to content

Symfony Entity Manager -> getRepository question #7

Open
@michaelt-94

Description

@michaelt-94

Hello,

Thank you for writing this bundle, I tried three different ones before yours and this is the only one I could make work. However, it seems to be a little too magical. When using EntityManagerInterface -> getRepository -.findBy() metohd. I am trying to the order my items in desc order on the 'create_at' field. Here is my call

$allNotes = $em->getRepository(Note::class)->findBy(['client_id' => $id], ['created_at' => 'desc']);

I noticed that when migrations are ran that the timestampable properties are not added directly to the Entity itself (no getters or setters == Magic!) So when using the getRepository metohds, I cannot use that property even when I add those to the entity. Have you had this issue?

Do you have any work arounds or suggestions?

Thank you.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions