From a61781948b0fc6ec8bf9199828b117278f5c7797 Mon Sep 17 00:00:00 2001 From: Messias Dias Date: Sun, 16 May 2021 11:17:40 -0300 Subject: [PATCH] Define method Basicis\Model\Model::setId() to fix error acordding with issue #52 --- src/Model/Model.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Model/Model.php b/src/Model/Model.php index c694dd9..14f45b0 100644 --- a/src/Model/Model.php +++ b/src/Model/Model.php @@ -87,6 +87,20 @@ public function getProtecteds() : array return $this->protecteds; } + /** + * Function setId + * Set entity ID (unique on system identification) + * @param int $id + * @return Model + */ + public function setId(int $id = null) : Model + { + if ($id > 0) { + $this->id = $id; + } + return $this; + } + /** * Function getId * Return entity ID (unique on system identification)