Replace findOneById by findPk
This commit is contained in:
@@ -64,10 +64,10 @@ class Category extends BaseCategory
|
|||||||
public function getRoot($categoryId)
|
public function getRoot($categoryId)
|
||||||
{
|
{
|
||||||
|
|
||||||
$category = CategoryQuery::create()->findOneById($categoryId);
|
$category = CategoryQuery::create()->findPk($categoryId);
|
||||||
|
|
||||||
if(0 !== $category->getParent()) {
|
if(0 !== $category->getParent()) {
|
||||||
$parentCategory = CategoryQuery::create()->findOneById($category->getParent());
|
$parentCategory = CategoryQuery::create()->findPk($category->getParent());
|
||||||
|
|
||||||
if (null !== $parentCategory) {
|
if (null !== $parentCategory) {
|
||||||
$categoryId = $this->getRoot($parentCategory->getId());
|
$categoryId = $this->getRoot($parentCategory->getId());
|
||||||
|
|||||||
@@ -63,10 +63,10 @@ class Folder extends BaseFolder
|
|||||||
public function getRoot($folderId)
|
public function getRoot($folderId)
|
||||||
{
|
{
|
||||||
|
|
||||||
$folder = FolderQuery::create()->findOneById($folderId);
|
$folder = FolderQuery::create()->findPk($folderId);
|
||||||
|
|
||||||
if(0 !== $folder->getParent()) {
|
if(0 !== $folder->getParent()) {
|
||||||
$parentFolder = FolderQuery::create()->findOneById($folder->getParent());
|
$parentFolder = FolderQuery::create()->findPk($folder->getParent());
|
||||||
|
|
||||||
if (null !== $parentFolder) {
|
if (null !== $parentFolder) {
|
||||||
$folderId = $this->getRoot($parentFolder->getId());
|
$folderId = $this->getRoot($parentFolder->getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user