An obligation is a legal duty, by which one person is bound to do or not to do a certain thing, and arises from either of the following:
(a) Contract.
(b) Operation of law.
(Amended by Stats. 2017, Ch. 561, Sec. 21. (AB 1516) Effective January 1, 2018.)