Project

General

Profile

Bug #89295 » extbase-querysettings.diff

Patchfile for this issue - Frank Berger, 2019-09-27 16:20

View differences:

../../../patch/extbase/Classes/Persistence/Generic/PersistenceManager.php 2019-09-26 14:37:58.625229542 +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);
}
/**
../../../patch/extbase/Classes/Persistence/Generic/QueryFactoryInterface.php 2019-09-26 14:37:35.189730521 +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);
}
../../../patch/extbase/Classes/Persistence/Generic/QueryFactory.php 2019-09-26 14:37:35.177730777 +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(\TYPO3\CMS\Extbase\Persistence\QueryInterface::class, $className);
$querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
$querySettings = $defaultQuerySettings ?? $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
$dataMap = $this->dataMapFactory->buildDataMap($className);
if ($dataMap->getIsStatic() || $dataMap->getRootLevel()) {
../../../patch/extbase/Classes/Persistence/PersistenceManagerInterface.php 2019-09-26 14:37:35.185730606 +0200
* The TYPO3 project - inspiring people to share!
*/
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);
}
../../../patch/extbase/Classes/Persistence/Repository.php 2019-09-26 14:19:46.776000000 +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);
}
(1-1/2)