From 2be8fd72ece6fb90561e46d337dd74b9fbada86d Mon Sep 17 00:00:00 2001 From: Ihor Sviziev Date: Tue, 11 Jul 2017 18:57:02 +0300 Subject: [PATCH] Add comments in Abstract model to deprecated methods --- .../Magento/Framework/Model/AbstractModel.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php index 90f0b3afe3ba7..1b16f6adf39e3 100644 --- a/lib/internal/Magento/Framework/Model/AbstractModel.php +++ b/lib/internal/Magento/Framework/Model/AbstractModel.php @@ -523,7 +523,9 @@ public function getCollection() * @param integer $modelId * @param null|string $field * @return $this - * @deprecated + * @deprecated because entities must not be responsible for their own loading. + * Service contracts should persist entities. Use resource model "load" or collections to implement + * service contract model loading operations. */ public function load($modelId, $field = null) { @@ -624,7 +626,9 @@ public function setHasDataChanges($flag) * * @return $this * @throws \Exception - * @deprecated + * @deprecated because entities must not be responsible for their own persistence. + * Service contracts should persist entities. Use resource model "save" to implement + * service contract persistence operations. */ public function save() { @@ -809,7 +813,9 @@ public function afterSave() * * @return $this * @throws \Exception - * @deprecated + * @deprecated because entities must not be responsible for their own deletion. + * Service contracts should delete entities. Use resource model "delete" method to implement + * service contract persistence operations. */ public function delete() {