From 6261e0e304ace98f78b4ecfc4f417d9b6231733e Mon Sep 17 00:00:00 2001 From: ostashevdv Date: Wed, 25 Nov 2015 14:51:20 +0300 Subject: [PATCH] Update ProductParameterName.php --- protected/models/product/ProductParameterName.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protected/models/product/ProductParameterName.php b/protected/models/product/ProductParameterName.php index 303527c5..9612df40 100644 --- a/protected/models/product/ProductParameterName.php +++ b/protected/models/product/ProductParameterName.php @@ -90,7 +90,7 @@ public function defaultScope() */ public function getRootId() { - return $this->findBySql("SELECT * FROM ".$this->dbConnection->schema->quoteTableName($this->tableName())." WHERE parent = id")->id; + return $this->find('parent = id')->id; } /** @@ -319,4 +319,4 @@ public function getImage() { return 'f/upload/images/param_'.$this->id.'.png'; } -} \ No newline at end of file +}