G
G
grabbee2017-01-25 12:14:23
Doctrine ORM
grabbee, 2017-01-25 12:14:23

How are computed properties implemented in Doctrine ORM?

There is a date field in the table, but when receiving data, you need to get seconds "ago" (time() - $timestamp) as well. If you understand correctly, you need to create a new property in the entity, and access the date in it. How to do it right?
Force install via postLoad ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2017-01-25
@miraage

Я бы создал геттер и добавил это поле в сериализатор.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question