zfcampus / zf-apigility-doctrine

Doctrine-enabled services for Apigility
BSD 3-Clause "New" or "Revised" License
107 stars 50 forks source link

Allowing change embbeded entities #166

Open fabioginzel opened 9 years ago

fabioginzel commented 9 years ago

He should not allow change embbeded entities, like this: {"id":"3", "descricao":"name", "tppdvi":{"id":"1", "descricao":"update name"} }

TomHAnderson commented 9 years ago

I don't understand what you're reporting. Are you talking about embedded data in ODM? Is this PUT or PATCH? What does tppdvi represent?

fabioginzel commented 9 years ago

Tppdvi is a embedded doctrine entity and apigility allows to change the descricao field.

TomHAnderson commented 9 years ago

That's interesting. Are you using ODM or ORM? Is there more about this you can add?

fabioginzel commented 9 years ago

I called a translator.

I'm using apigility with doctrine. When I send a patch to the main entity I'm trying to update, it's also updating an embedded entity.

For example, let's say we have a students table and a courses table. The student entity has it's course embedded.

When I patch the student entity, if somehow the course entity name is changed, it updates the course name on the courses table.

TomHAnderson commented 9 years ago

Database = MySQL? MongoDB?

fabioginzel commented 9 years ago

I've tested on MS Sql Server and PostgreSql.

TomHAnderson commented 9 years ago

@veewee what do you think of this? Are your hydrators too good?

takethefake commented 9 years ago

any news on this? I like the Idea of Posting directly to the subentities but i think there is a need to call the input validators of the nested entity, otherwise you'll run into errors.

TomHAnderson commented 9 years ago

@veewee bumping this. I'd sure appreciate your insight on this.

veewee commented 9 years ago

Hi @TomHAnderson Sadly, I haven't found the time to follow this repo up to the latest version. It's exactly the same as with forms: if you submit the field: tppdvi[descricao]=test, the field will be updated in the database. I am perfectly fine with this feature and am using this on some projects.

If you don't want this feature, you can filter / validate the input yourself on pre-update ?

fabioginzel commented 9 years ago

But if my user dont have permission to change embbeded entity?

jguittard commented 8 years ago

@fabioginzel @veewee ping

fabioginzel commented 8 years ago

hi

michalbundyra commented 6 years ago

@fabioginzel do you still need any help with it or you have found the solution?

weierophinney commented 4 years ago

This repository has been closed and moved to laminas-api-tools/api-tools-doctrine; a new issue has been opened at https://github.com/laminas-api-tools/api-tools-doctrine/issues/9.