Passed
Push — master ( 134b43...f02d33 )
by Ralf
09:50
created

AbstractRepository::crossClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 1
1
<?php
2
namespace EWW\Dpf\Domain\Repository;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
17
/**
18
 * The abstract repository
19
 */
20
class AbstractRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
21
{
22
    /**
23
     * Finds all records of all clients.
24
     *
25
     * @param bool $returnRawQueryResult
26
     * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
27
     */
28
    public function crossClientFindAll($returnRawQueryResult = TRUE) {
29
        /** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */
30
        $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
31
        $querySettings->setRespectStoragePage(false);
32
        $this->setDefaultQuerySettings($querySettings);
33
        $query = $this->createQuery();
34
        return $query->execute($returnRawQueryResult);
35
    }
36
37
    public function crossClient($active = false)
38
    {
39
        /** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */
40
        $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
41
        $querySettings->setRespectStoragePage(!$active);
42
        $this->setDefaultQuerySettings($querySettings);
43
    }
44
}
45