From d4779859c975882fed3eaa37c2c88ef80e69c6f9 Mon Sep 17 00:00:00 2001 From: Bjverde Date: Tue, 27 Sep 2022 22:18:24 -0300 Subject: [PATCH] =?UTF-8?q?:bug:=20#118=20corre=C3=A7=C3=A3o=20validar=20p?= =?UTF-8?q?k=20not=20exist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/CreateControllers.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/CreateControllers.class.php b/controllers/CreateControllers.class.php index 0d52332..b08d090 100644 --- a/controllers/CreateControllers.class.php +++ b/controllers/CreateControllers.class.php @@ -142,7 +142,7 @@ private function addValidatePkNotExist() $this->addLine(ESP.'{'); $this->addLine(ESP.ESP.'$where=array(\''.$columunPK.'\'=>$id);'); $this->addLine(ESP.ESP.'$qtd = $this->selectCount($where);'); - $this->addLine(ESP.ESP.'if($qtd >= 1){'); + $this->addLine(ESP.ESP.'if( empty($qtd) ){'); $this->addLine(ESP.ESP.ESP.'throw new DomainException(Message::GENERIC_ID_NOT_EXIST);'); $this->addLine(ESP.ESP.'}'); $this->addLine(ESP.'}');