diff --git a/db/migrations/PageTrait.php b/db/migrations/PageTrait.php index db651abd..e0e87baf 100644 --- a/db/migrations/PageTrait.php +++ b/db/migrations/PageTrait.php @@ -11,7 +11,7 @@ trait PageTrait protected function insertPages(array $rows) { foreach ($rows as $key => $row) { - $exists = $this->pageExits($row['alias']); + $exists = $this->pageExists($row['alias']); if ($exists) unset($rows[$key]); } @@ -20,7 +20,7 @@ trait PageTrait $this->table('kg_page')->insert($rows)->save(); } - protected function pageExits($alias) + protected function pageExists($alias) { $row = $this->getQueryBuilder() ->select('*') @@ -28,7 +28,7 @@ trait PageTrait ->where(['alias' => $alias]) ->execute()->fetch(); - return $row ? true : false; + return (bool)$row; } } \ No newline at end of file diff --git a/db/migrations/SettingTrait.php b/db/migrations/SettingTrait.php index 84d39deb..02f5374e 100644 --- a/db/migrations/SettingTrait.php +++ b/db/migrations/SettingTrait.php @@ -11,7 +11,7 @@ trait SettingTrait protected function insertSettings(array $rows) { foreach ($rows as $key => $row) { - $exists = $this->settingExits($row['section'], $row['item_key']); + $exists = $this->settingExists($row['section'], $row['item_key']); if ($exists) unset($rows[$key]); } @@ -20,7 +20,7 @@ trait SettingTrait $this->table('kg_setting')->insert($rows)->save(); } - protected function settingExits($section, $itemKey) + protected function settingExists($section, $itemKey) { $row = $this->getQueryBuilder() ->select('*') @@ -28,7 +28,7 @@ trait SettingTrait ->where(['section' => $section, 'item_key' => $itemKey]) ->execute()->fetch(); - return $row ? true : false; + return (bool)$row; } } \ No newline at end of file