ornicar/OrnicarMessageBundle — Issue #31: Inconsistent behavior in Message::setIsReadByParticipant()
Author: jmikola
Created: 2011-12-07 21:38:29+00:00
State: open

Comparing [the document method](https://github.com/ornicar/OrnicarMessageBundle/blob/56deccbc550142cc03b0ed4244f311801086b616/Document/Message.php#L42) with [the entity method](https://github.com/ornicar/OrnicarMessageBundle/blob/56deccbc550142cc03b0ed4244f311801086b616/Entity/Message.php#L49), the entity is prone to throwing an exception if the participant does not exist. The document is more robust in that it will simply set the value in its hash.

I noticed that `Thread::setIsDeletedByParticipant()` for both the document and entity models did not have this behavior of throwing an exception for an unrecognized participant.

I'm currently working on refactoring the documents (for MongoDB scalability issues), and I was curious what the proper behavior should be. Ideally, all of these methods (for both setting isReadBy and isDeleted) should be consistent with one another.