Skip to content

Commit

Permalink
Update ObjectsFetcher.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi authored Oct 4, 2023
1 parent a6a33ce commit 6ff1a40
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/DataDefinitionsBundle/Fetcher/ObjectsFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
namespace Wvision\Bundle\DataDefinitionsBundle\Fetcher;

use InvalidArgumentException;
use Pimcore\Model\DataObject\AbstractObject;
use Pimcore\Model\DataObject\ClassDefinition;
use Pimcore\Model\DataObject\Concrete;
use Pimcore\Model\DataObject\Listing;
use Wvision\Bundle\DataDefinitionsBundle\Context\FetcherContextInterface;
use Wvision\Bundle\DataDefinitionsBundle\Model\ExportDefinitionInterface;
Expand Down Expand Up @@ -60,12 +60,12 @@ private function getClassListing(ExportDefinitionInterface $definition, array $p
$rootNode = null;
$conditionFilters = [];
if (isset($params['root'])) {
$rootNode = Concrete::getById($params['root']);
$rootNode = AbstractObject::getById($params['root']);

if (null !== $rootNode) {
$quotedPath = $list->quote($rootNode->getRealFullPath());
$quotedWildcardPath = $list->quote(str_replace('//', '/', $rootNode->getRealFullPath().'/').'%');
$conditionFilters[] = '(o_path = '.$quotedPath.' OR o_path LIKE '.$quotedWildcardPath.')';
$conditionFilters[] = '(path = '.$quotedPath.' OR path LIKE '.$quotedWildcardPath.')';
}
}

Expand All @@ -79,10 +79,10 @@ private function getClassListing(ExportDefinitionInterface $definition, array $p
}

if (isset($params['only_direct_children']) && $params['only_direct_children'] == 'true' && null !== $rootNode) {
$conditionFilters[] = 'o_parentId = '.$rootNode->getId();
$conditionFilters[] = 'parentId = '.$rootNode->getId();
}

if (isset($params['condition'])) {
if (isset($params['condition'])) {
$conditionFilters[] = '('.$params['condition'].')';
}
if (isset($params['ids'])) {
Expand Down

0 comments on commit 6ff1a40

Please sign in to comment.