1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* This program is free software: you can redistribute it and/or modify |
4
|
|
|
* it under the terms of the GNU General Public License as published by |
5
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
6
|
|
|
* (at your option) any later version. |
7
|
|
|
* |
8
|
|
|
* This program is distributed in the hope that it will be useful, |
9
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
10
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11
|
|
|
* GNU General Public License for more details. |
12
|
|
|
* |
13
|
|
|
* You should have received a copy of the GNU General Public License |
14
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
namespace Filoucrackeur\Hubic\Domain\Repository; |
18
|
|
|
|
19
|
|
|
use TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings; |
20
|
|
|
use TYPO3\CMS\Extbase\Persistence\QueryInterface; |
21
|
|
|
use TYPO3\CMS\Extbase\Persistence\Repository; |
22
|
|
|
|
23
|
|
|
class AccountRepository extends Repository |
24
|
|
|
{ |
25
|
|
|
// Order by BE sorting |
26
|
|
|
protected $defaultOrderings = [ |
27
|
|
|
'sorting' => QueryInterface::ORDER_ASCENDING, |
28
|
|
|
]; |
29
|
|
|
|
30
|
|
|
public function initializeObject() |
31
|
|
|
{ |
32
|
|
|
/** @var $defaultQuerySettings Typo3QuerySettings */ |
33
|
|
|
$defaultQuerySettings = $this->objectManager->get(Typo3QuerySettings::class); |
34
|
|
|
|
35
|
|
|
// don't add the pid constraint |
36
|
|
|
$defaultQuerySettings->setRespectStoragePage(false); |
37
|
|
|
// don't add sys_language_uid constraint |
38
|
|
|
$defaultQuerySettings->setRespectSysLanguage(true); |
39
|
|
|
$this->setDefaultQuerySettings($defaultQuerySettings); |
40
|
|
|
} |
41
|
|
|
} |
42
|
|
|
|