{"id":47,"date":"2015-08-13T17:30:21","date_gmt":"2015-08-13T17:30:21","guid":{"rendered":"https:\/\/maximoconcepts.wordpress.com\/?p=47"},"modified":"2015-08-13T17:30:21","modified_gmt":"2015-08-13T17:30:21","slug":"isnew-vs-tobeadded-methods-in-mbo","status":"publish","type":"post","link":"https:\/\/maximoconcepts.com\/2015\/08\/13\/isnew-vs-tobeadded-methods-in-mbo\/","title":{"rendered":"isNew() vs toBeAdded() Methods in MBO"},"content":{"rendered":"
Often this question is asked that what is the difference between\u00a0isNew() and\u00a0toBeAdded() methods of the Mbo. Before I explain the difference let me tell you what these methods are –<\/p>\n
All these method are in the psdi.mbo.Mbo class and have a return type as\u00a0Boolean.<\/p>\n
The difference is explained using the scenarios in the below table<\/p>\n
Scenario<\/strong><\/td>\nisNew()\u00a0<\/strong><\/td>\n | toBeAdded()<\/strong><\/td>\n | toBeDeleted()<\/strong><\/td>\n | toBeSaved()<\/strong><\/td>\n<\/tr>\n | New Mbo Added<\/td>\n | True<\/td>\n | True<\/td>\n | False<\/td>\n | True<\/td>\n<\/tr>\n | New Mbo Added, deleted before saving the Mbo<\/td>\n | True<\/td>\n | False<\/td>\n | True<\/td>\n | False<\/td>\n<\/tr>\n | Existing Mbo updated<\/td>\n | False<\/td>\n | False<\/td>\n | False<\/td>\n | True<\/td>\n<\/tr>\n | Existing Mbo deleted<\/td>\n | False<\/td>\n | False<\/td>\n | True<\/td>\n | False<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":" | Often this question is asked that what is the difference between\u00a0isNew() and\u00a0toBeAdded() methods of the Mbo. Before I explain the difference let me tell you what these methods are – isNew() – Returns whether the mbo is new or not. true, if the mbo is new (i.e. created by calling add() or insert() methods), otherwise … Continue reading isNew() vs toBeAdded() Methods in MBO<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13,5],"tags":[],"yoast_head":"\n |