|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* (c) Kitodo. Key to digital objects e.V. <[email protected]> |
|
5
|
|
|
* |
|
6
|
|
|
* This file is part of the Kitodo and TYPO3 projects. |
|
7
|
|
|
* |
|
8
|
|
|
* @license GNU General Public License version 3 or later. |
|
9
|
|
|
* For the full copyright and license information, please read the |
|
10
|
|
|
* LICENSE.txt file that was distributed with this source code. |
|
11
|
|
|
*/ |
|
12
|
|
|
|
|
13
|
|
|
namespace Kitodo\Dlf\Domain\Repository; |
|
14
|
|
|
|
|
15
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility; |
|
16
|
|
|
use TYPO3\CMS\Core\Database\ConnectionPool; |
|
17
|
|
|
use Kitodo\Dlf\Common\Helper; |
|
18
|
|
|
|
|
19
|
|
|
class MetadataRepository extends \TYPO3\CMS\Extbase\Persistence\Repository |
|
20
|
|
|
{ |
|
21
|
|
|
public function getMetadataForListview($pages) { |
|
22
|
|
|
$query = $this->createQuery(); |
|
23
|
|
|
|
|
24
|
|
|
$query->matching($query->logicalOr([ |
|
25
|
|
|
$query->equals('is_listed', 1), |
|
26
|
|
|
$query->equals('is_sortable', 1) |
|
27
|
|
|
])); |
|
28
|
|
|
$query->matching($query->equals('pid', $pages)); |
|
29
|
|
|
|
|
30
|
|
|
$query->setOrderings([ |
|
31
|
|
|
'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING |
|
32
|
|
|
]); |
|
33
|
|
|
|
|
34
|
|
|
return $query->execute(); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function getMetadata($pages, $sysLangUid) { |
|
38
|
|
|
$query = $this->createQuery(); |
|
39
|
|
|
|
|
40
|
|
|
$querySettings = $query->getQuerySettings(); |
|
41
|
|
|
$querySettings->setLanguageUid($sysLangUid); |
|
42
|
|
|
$querySettings->setLanguageOverlayMode('strict'); |
|
43
|
|
|
|
|
44
|
|
|
$query->matching($query->equals('pid', $pages)); |
|
45
|
|
|
|
|
46
|
|
|
return $query->execute(); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
} |