G
G
getNullData2017-01-31 13:33:20
PHP
getNullData, 2017-01-31 13:33:20

How to write an array of data to an entity using doctrine?

Good afternoon.
Actually the following interests:
There are 2 entities.
TBL
PHONES

We have an array of data

$tbl = [
      'tbl_id' => 1,
      'name'   => 'test',
      'phones' => [1, 2, 3, 4]
];

Using the doctrine, we fill in the table tbl
id =1, name = 'test'
and also fill in phones
tbl_id = 1, phone = 1
tbl_id = 1, phone = 2
mapping?
oneToMany:
        phones:
            targetEntity: Phones
            mappedBy: Tbl

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question