Skip to content

Commit

Permalink
Merge pull request Automattic#792 from thatmarvin/2.x
Browse files Browse the repository at this point in the history
Automattic#751: document caveat on getters regarding Model.update()
  • Loading branch information
aheckmann committed Mar 26, 2012
2 parents d64555e + 262a114 commit b841055
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/getters-setters.md
Expand Up @@ -47,6 +47,9 @@ Suppose you are storing credit card numbers and you want to hide everything exce
console.log(found.creditCardNumber); // '****-****-****-1234'
});


**Important!** Note that getters only works when creating or modifying `Document` instances; it will not be invoked when `Document` instances are not involved like in `Model.update()`.

## Summary

Setters are intended to modify the underlying raw data. Getters are intended to transform (but not modify at the raw data level) the underlying raw data into something that the user expects to see. They are both defined in the `Schema` definition.

0 comments on commit b841055

Please sign in to comment.