Project

General

Profile

Bug #89295 » extbase-querysettings-10.diff

Markus Hofmann, 2020-11-09 18:46

View differences:

patches/extbase/Classes/Persistence/Generic/PersistenceManager.php 2020-07-15 16:19:06.736365290 +0200
* Return a query object for the given type.
*
* @param string $type
* @param null|QuerySettingsInterface $defaultQuerySettings
* @return QueryInterface
* @internal only to be used within Extbase, not part of TYPO3 Core API.
*/
public function createQueryForType($type)
public function createQueryForType($type, $defaultQuerySettings = null)
{
return $this->queryFactory->create($type);
return $this->queryFactory->create($type, $defaultQuerySettings);
}
/**
patches/extbase/Classes/Persistence/Generic/QueryFactoryInterface.php 2020-07-15 16:19:06.744365294 +0200
* Creates a query object working on the given class name
*
* @param string $className The class name
* @param null|QuerySettingsInterface $defaultQuerySettings
* @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
*/
public function create($className);
public function create($className, $defaultQuerySettings = null);
}
patches/extbase/Classes/Persistence/Generic/QueryFactory.php 2020-07-15 16:15:51.580360990 +0200
* Creates a query object working on the given class name
*
* @param string $className The class name
* @param null|QuerySettingsInterface $defaultQuerySettings
* @return \TYPO3\CMS\Extbase\Persistence\QueryInterface
* @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception
*/
public function create($className)
public function create($className, $defaultQuerySettings = null)
{
$query = $this->objectManager->get(QueryInterface::class, $className);
$querySettings = $this->objectManager->get(QuerySettingsInterface::class);
$querySettings = $defaultQuerySettings ?? $this->objectManager->get(QuerySettingsInterface::class);
$dataMap = $this->dataMapFactory->buildDataMap($className);
if ($dataMap->getIsStatic() || $dataMap->getRootLevel()) {
patches/extbase/Classes/Persistence/PersistenceManagerInterface.php 2020-07-15 16:19:06.740365293 +0200
namespace TYPO3\CMS\Extbase\Persistence;
use TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface;
/**
* The Extbase Persistence Manager interface
*/
......
* Return a query object for the given type.
*
* @param string $type
* @param QuerySettingsInterface $defaultQuerySettings
* @return QueryInterface
*/
public function createQueryForType($type);
public function createQueryForType($type, $defaultQuerySettings);
}
patches/extbase/Classes/Persistence/Repository.php 2020-07-15 16:19:06.748365295 +0200
*/
public function createQuery()
{
$query = $this->persistenceManager->createQueryForType($this->objectType);
$query = $this->persistenceManager->createQueryForType($this->objectType, $this->defaultQuerySettings);
if ($this->defaultOrderings !== []) {
$query->setOrderings($this->defaultOrderings);
}
(2-2/2)