From a47cb63afa701a5ca1ddf07d81b1c93f45fdd45d Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sun, 11 Jul 2021 15:59:06 +0200 Subject: Reuse prepared statement in update method Reuse the already defined prepared statement in the update method of the Category repository instead of creating a new one. --- core/namespace/ORM/Repositories/Category.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/namespace/ORM/Repositories/Category.php b/core/namespace/ORM/Repositories/Category.php index bd7d060..ead54a4 100644 --- a/core/namespace/ORM/Repositories/Category.php +++ b/core/namespace/ORM/Repositories/Category.php @@ -109,10 +109,6 @@ class Category extends Repository { return parent::update($Entity); } - $query = 'SELECT parent FROM %s WHERE id = ?'; - $query = sprintf($query, static::getTableName()); - - $Statement = $this->Database->prepare($query); $_parent = $Entity->get('parent'); # Fetch the parent of the *new* parent category and let the while loop run through -- cgit v1.2.3