S
S
Stanislav2019-12-21 11:35:24
Doctrine ORM
Stanislav, 2019-12-21 11:35:24

Doctrine ORM: Is it possible to not map entire objects?

The task is as follows: to read a couple of columns from a table into a database (PostgreSQL) using Doctrine.
Question: Is it possible to do this using an ORM? At the same time, I do not want (do not need to) read all the columns, only a few values ​​are needed.
Clarification: in the future, it may be necessary not only to read from this table, but also to write to it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Romashkan, 2019-12-21
@lamo4ok

is it possible not to map objects entirely?

You can forget about crutches with mapping some object fields, and describe separate DTO classes with the necessary fields.
Documentation - https://www.doctrine-project.org/projects/doctrine...
ps Entity when using DataMapper != label in the database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question